-
Notifications
You must be signed in to change notification settings - Fork 841
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
Warning messages are printed with colors that are invisible on white background #4047
Comments
The offending lines in the source code are https://github.com/commercialhaskell/stack/blob/master/src/Stack/PrettyPrint.hs#L167
and https://github.com/commercialhaskell/stack/blob/master/src/Stack/PrettyPrint.hs#L181
Looking at the source, I see that |
Thanks @brianhuffman - that's definitely aggravating. It's not a full solution, but are you aware of the It looks like you're using macOS. Are you running the standard terminal or something else (e.g. |
Yes, I'm on MacOS, and I usually use iterm2. |
The actual colors chosen are determined by your terminal, so I do not think that this is something that needs to be addressed in stack. |
@mgsloan Are you suggesting that I should remap the color "white" in my terminal to something dark? |
Or remap the yellow to a darker shade. CLI apps are going to be using these colors, so they should be configured to be readable, if you want them to be readable. |
I can deal with the yellow. The white-on-white is more of a problem. iTerm2 is configurable enough so that there are some workarounds for it (I found a "minimum contrast" setting) but for MacOS Terminal there aren't really any good options, short of redefining ANSI "white" to something that isn't white, or switching to a darker background color that is also visibly distinct from any other ANSI color. (Many of us who prefer white-background terminals do so because it matches the brightness level of all the other light-color-themed windows on our display, of which there are many on MacOS.) Imagine if a command-line tool that you use had been designed (by white-background-terminal-using developers) to output text in ANSI black? I propose that
This should provide the desired visible emphasis no matter what terminal color scheme is in use. |
Oh, yes, I see. Yes, it makes sense to change that. One possible solution might be to set the background color dark for files. Alternatively, picking another color. I quite like how it currently looks, though. |
I would be perfectly happy if the white text was also shown with a specified background color (e.g. black). |
@brianhuffman I believe that this PR will resolve the issue #4079 |
Prettyprinting colors should also have a background that contrasts #4047
Closing, since this appears to have been addressed by #4079. |
In order to ensure sufficient contrast on both black (dull black) and white (vivid white) terminals, also changes foreground text `bold . white` to `dullcyan` (affecting `styleFile` and `styleUrl`) and `yellow` to `dullyellow` (affecting `styleWarning` and `styleCurrent`). `dullcyan` is used in preference to `black` (vivid black) because the latter is problematic with the solarised dark theme. See also issue commercialhaskell#4047 and (reverted) commercialhaskell#4814.
In order to ensure sufficient contrast on both black (dull black) and white (vivid white) terminals, also changes foreground text `bold . white` to `dullcyan` (affecting `styleFile` and `styleUrl`) and `yellow` to `dullyellow` (affecting `styleWarning` and `styleCurrent`). `dullcyan` is used in preference to `black` (vivid black) because the latter is problematic with the solarised dark theme. See also issue commercialhaskell#4047 and (reverted) commercialhaskell#4814.
Here's an example of a warning message that I received from a recent run of
stack build
:The problem is that on my terminal, which uses the default black-text-on-white-background theme, it looks like this:
The filenames are printed in a completely invisible bold white, and the word "Warning" is printed in a yellow color that is just barely visible against a white background. The text is only readable after highlighting it with the mouse.
To reproduce: Using a terminal with a dark-text-on-light-background theme, run any
stack
command that prints any kind of warning message.Here is the output of
stack --version
:The text was updated successfully, but these errors were encountered: