-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Color is non-functional (Win32) #26
Comments
Color is not enabled by default on Windows, see here. Does it work if you explicitly enable it? |
Oh, that should be put in the documentation, too. But no, it's still just white on black when I use |
I gave a shot at fixing this and completely failed, but maybe I can get the obvious ones out of the way.
This printed At this point I have absolutely no idea what to try. It's like the console is correctly being colored, but then we print to a different console or something. Wish I could help more :( |
A little more debugging: in the above code, if you replace
I traced the call stack back to IPC::Open3 line 410, which calls It seems to me that |
The problem (as far as I can tell) is that it's applying color settings to the wrong handle (STDOUT instead of STDERR). With that trivial change I see colorized output. I've submitted a pull request. That said, the output isn't quite what I expected. Test failures are red, but passed tests and diagnostics aren't colorized. The only time I see green is for an "all tests passed" summary. Another option to fix the issue is to drop use of Win32::Console altogether. Term::ANSIColor works on Windows if you also load Win32::Console::ANSI. That would simplify the code in TAP::Formatter::Color. I don't know if there's a reason to prefer one module over the other. |
+ rationale: using Win32::Console::ANSI simplifies the code and improves Win32 outputs - simplified usage ~ Win32::Console::ANSI is fire-and-forget - once loaded, use Term::ANSIColor without regard for platform - fixes incorrect color 'reset' behavior - Win32::Color::ANSI resets correctly to the prior default color attribute set - bug due to incorrect assumption that LIGHTGRAY on BLACK are always the default color attributes - fixes [GH#26](Perl-Toolchain-Gang#26) - Win32::Console::ANSI works for all output (no tie to a specific output handle) - [PR#34](Perl-Toolchain-Gang#34) is no longer needed
+ rationale: using Win32::Console::ANSI simplifies the code and improves Win32 outputs - simplified usage ~ Win32::Console::ANSI is fire-and-forget - once loaded, use Term::ANSIColor without regard for platform - fixes incorrect color 'reset' behavior - Win32::Color::ANSI resets correctly to the prior default color attribute set - bug due to incorrect assumption that LIGHTGRAY on BLACK are always the default color attributes - fixes [GH#26](#26) - Win32::Console::ANSI works for all output (no tie to a specific output handle) - [PR#34](#34) is no longer needed
I have installed Win32::Console (and Term::ANSIColor just in case), but do not see color output. Googling around I got a more detailed SO question. I know that color output otherwise works because
ack
now has colored output, and it also uses Win32::Console to achieve this.Using Windows 7, Strawberry 5.18.1.1, Test::Harness 3.29.
The text was updated successfully, but these errors were encountered: