-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Change default warn color to yellow #18453
Conversation
guess the only question is why was it set to red from the beginning? |
Hah! Found it 68f63db#diff-2b2ebeef35e91b1fff15d49dc1d526b5R50. It got changed from yellow to red 3 ½ years ago. @StefanKarpinski didn't like the yellow. Apparently it was red for a while then yellow then red again... lol |
Yes, Red for errors, yellow for warning goes nicely with traffic light colors. |
Definitely a good idea to differentiate warnings from errors. I've had students who thought (in R) that a package wasn't installed correctly just because an innocent warning was printed in red. |
To make everyone happy, can we use 256-colour orange if it's available, and fall back to yellow otherwise? Or is this possibly infeasible for portability? |
I don't really have an issue with yellow for warnings. This is why we really should ship our own terminal of some kind on Windows. On UNIX we're always going to need to deal with people's terminals, but xterm-265 should be possible on most UNIX systems. |
My impression is that most hardcore SW developers use dark terminal/editor backgrounds. But I hope you will at least give some consideration to users who prefer light backgrounds. Yellow on white (and also cyan on white) are not great combinations. I certainly understand that it is hard, bordering on impossible, to choose colours that look good for both light and dark backgrounds. I also have a (non-empirical, gut-level) hunch that people who use light backgrounds are less likely to tweak their setup. |
The solution to the white terminal is to have two profiles - light and dark and make it easy to switch. |
Well, it is defined to be yellow at least.. http://pueblo.sourceforge.net/doc/manual/ansi_color_codes.html |
I guess some terminals does that which is why the bold yellow looks so bad on white. |
@TotalVerb AFAIU, detecting if a terminal supports 256 colors is tricky because terminals lie through their teeth. I can however give you #18473 so you can easily set orange yourself. |
I kinda prefer orange over yellow. |
And after #18473 you can easily set that with an env var. What we are talking about here is the default color and for that orange is out of the question due to not being supported in many default / unconfigured terminals. |
0253ede
to
d8897d2
Compare
d8897d2
to
806db05
Compare
Added news entry, anyone opposed of merging? |
Bump. |
From the 9 thumbs up, 0 thumbs down and the triviality of reverting, I will merge this at the end of the weekend if no one has objections. |
That yellow will be pretty bad on light terminals. Is determining the background color any more doable than detecting 256 color support? We could also do yellow on Windows and orange elsewhere since I get the impression far fewer people use light background terminals on Windows, and it's the only place where 256 color support isn't a safe assumption. |
Guess I will focus on the non boldness in the colorized messages then which is what is causing this to look bad on white backgrounds. |
Rebased + hooked up pkg + test to use the warn color function. I tried the online merge resolution tool and it sort of messed up my branch... Anyway the total diff of these commit seems ok so should be fine to squash. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so now this prints the lead "WARNING" in bold but the rest of the content not bold, right?
@@ -140,7 +140,7 @@ type Broken <: Result | |||
orig_expr | |||
end | |||
function Base.show(io::IO, t::Broken) | |||
print_with_color(:yellow, io, "Test Broken\n"; bold = true) | |||
print_with_color(:Base.warn_color(), io, "Test Broken\n"; bold = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the :
meant to be prefixed to Base
here, or just a typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo (which I thought I fixed but maybe I forgot to commit the file).
Yes @tkelman. |
@@ -60,9 +60,9 @@ Library improvements | |||
Therefore, light versions of the colors are now supported. | |||
For the available colors see the help entry on `print_with_color`. | |||
|
|||
* The default color for info messages has been changed from blue to cyan ([#18442]). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should put this link back (and add 18453 too)
Change the warning color to what I believe is a better default (to yellow from red).
Reasons
xterm default
gnome-terminal default (ubuntu default)
gnome-terminal white background (this one is not so nice...)
powershell
win cmd
cc @twadleigh