You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Display with red text makes errors look like they are problems, when they are often just informative. It also makes it difficult to style messages with crayon because we don't know what the default text colour will be.
Reacted by Breck Yunits, rbarakjsonar, Jim Hester, Mark Zwart, Jessica Visser, etienne-s, Hugo Gruson, profPlum, Katrin Leinweber, Jennifer (Jenny) Bryan and 28 more
Differentiating between message()warning()stop() and stderr() would be a great thing to have especially if you don't have to change the text formatting. E.g. maybe a colored flag next to the text or something similar
Note we will have the same issues with generating colored warnings and errors if they are continued to be colored red, so it is something to keep in mind.
Reacted by Katrin Leinweber, Hugo Gruson, Karl Ove Hufthammer, Svetlana Lebedeva and Josh
I believe that right now R only tags output as "normal" or "error", and stderr, warnings, and R errors all get the error treatment.
If we wanted to be more granular than that I think we'd need to explicitly overwrite the message() and warning() functions in the base package (even then we wouldn't catch warnings generated from native code so there would be some inconsistency of presentation).
I think the point about red being a bit too harsh for all these conditions is a good one. While I agree that it would be great to have 4 different colors, if we can't achieve that (and I don't think we can without some major hacking) then softening the default red presentation seems like a good idea.
Reacted by Jim Hester, Kevin Ushey, Sebastian Sauer, Katrin Leinweber and Sam Welch
amazing idea guys. You cant imagine how many times I missed that my code chunk actually didnt do anything because I didnt see that error line pop up among the output. Having errors in RED would be really useful!
This really would be amazing. Like @randomgambit mentioned, I often don't catch an error message because I've learned to ignore most red text in the console. I also waste time scanning through information searching for errors. This is my number 1 complaint about the UX in RStudio (Well, this is my number 2 complaint--my first complaint is that RStudio can't automatically fix my bugs, analyze my data for significant findings, and submit these findings to journals). Ignoring most of the red text in the console is very counter intuitive to anyone coming from another programming language.
The red is also very distracting in Jupyter. In the example below, my notebook looks like the Red Sea. In this example I know I could use "warn.conflicts" or "suppressPackageStartupMessages" to clean up the red, or click "hide outputs" everytime I run the cell, but adding ~4 tokens per line seems like a waste of effort to hide some red. I like to use "conflicted" to only alert me to an error when there potentially is one.
I think a convention around messages to stderr that could be parsed to format appropriately would be great. Or whatever you decide--I'm not familiar yet with the R/Rstudio internals.
UPDATE: I have since started playing with RMarkdown notebooks, which are awesome and have other ways of dealing with the red problems. But still, would be nice...
Using color as the only way to communicate something in the UI is an accessibility no-no as it is invisible to screen readers, those with color-blindness, and so forth.
If we do something like this, we need to make sure the information is "visible" to screen readers, and to sighted users who can't distinguish colors. Flagging as a (potential) accessibility issue so this gets considered should we do some work on this.
Reacted by Josiah Parry, Mathew Ling and Flora Winston
Please re-consider this in case of warnings. As an instructor to new R(studio) learners, I often get worried questions why this or that "didn't work" (e.g. installing packages on Windows without Rtools preset). Most often, checking what the problem could be reveals that they misinterpreted some red warning.
Yes, that's a good lesson in actually reading console output, but an unnecessary source of confusion. Orange would be neat :-)
@gtritchie I think you bring up a very similar, but perhaps separate issue. Accessibility of the colours and getting information from the colours is one issue.
There is also another issue that is very important: currently messages are red, which means that for any sighted non-colour-blind beginner user, they think something went wrong. Simply removing all colour would even be a better alternative at the moment for this issue specifically. Every time I teach a new group of people R, a few of them tell me that everything is failing just because they see all the red messages and assume that red = fail. So I would argue this red messages issue needs to be addressed as a high priority because it is a deterrent to a majority of new users. The accessibility issue here should be addressed but I'd say is a separate issue.
Reacted by Renan Xavier Cortes, dryguy, Mathew Ling and Eric Londaits
FWIW that specific example (red text in the output of install.packages()) wouldn't be entirely solved even if we had special handling for messages, as the output for package download is printed via REprintf():
It's obviously been a long time since this issue was first opened, but I would lean towards having stderr output unstyled by default, but perhaps only printed in red for error messages printed from uncaught errors?
Rather than just adjust the highlight of messages, we now display them with a sort of "banner" display, with a similar treatment for warnings and errors. For example:
This behavior can be adjusted; e.g. if you'd like this display for only specific condition types, or if you'd like to disable it altogether and return to the previous RStudio behavior.
Feedback is definitely appreciated!
Reacted by Ben Bolker, Chenghao Wang and Flora Winston
Reacted by Hugo Gruson, Dean Attali, Desi Quintans, Tom Mock and Flora Winston
The yellow Warning colour would be difficult to read with light themes.
This might be strange feedback, but would you consider either a Warning colour that is sort of neutral in connotation (e.g. brown), or perhaps a colour that's middlingly positive, like a yellow-green? I have always explained Warnings as, "Your code still worked, but there's something you should know about it, and that detail might be important or it might be no big deal." The yellow colour still signals "Slow down, something's wrong" to me.
The yellow Warning colour would be difficult to read with light themes.
We use slightly different colours for the light theme (orange for warnings; red for errors).
The colours could probably still be tweaked a bit to further increase the contrast, though -- maybe also bolding the red / orange text?
This might be strange feedback, but would you consider either a colour that is sort of neutral in connotation (e.g. brown), or perhaps a colour that's middlingly positive, like a yellow-green? I have always explained Warnings as, "Your code still worked, but there's something you should know about it, and that detail might be important or it might be no big deal." The yellow colour still signals "Slow down, something's wrong" to me.
That's great feedback -- I'll also raise this internally and see what others opinions are.
This is expected; the format of warning messages will differ based on whether options(warn = 0) is set or options(warn = 1) is set. I have options(warn = 1) set in my .Rprofile, but options(warn = 0) is the default.
I guess we could highlight the title "Warning message" in the second case?
Activity
jimhester commentedon Apr 3, 2018
Alternatives to coloring in red would be using bold, as is done by R by default in the macOS terminal, or doing nothing as is done on linux systems.
kevinushey commentedon Apr 3, 2018
Note that the issue is ultimately that all
stderr()output is colored like that:Do you think we should attempt out color
message()output distinctly fromstderr()output?hadley commentedon Apr 3, 2018
I think
stderrandmessage()should be formatted consistently -stderris generally for diagnostic messages, and not just errors.Warnings and errors should continue to print in red however.
jimhester commentedon Apr 3, 2018
Differentiating between
message()warning()stop()andstderr()would be a great thing to have especially if you don't have to change the text formatting. E.g. maybe a colored flag next to the text or something similarNote we will have the same issues with generating colored warnings and errors if they are continued to be colored red, so it is something to keep in mind.
jjallaire commentedon Apr 3, 2018
I believe that right now R only tags output as "normal" or "error", and stderr, warnings, and R errors all get the error treatment.
If we wanted to be more granular than that I think we'd need to explicitly overwrite the
message()andwarning()functions in the base package (even then we wouldn't catch warnings generated from native code so there would be some inconsistency of presentation).I think the point about red being a bit too harsh for all these conditions is a good one. While I agree that it would be great to have 4 different colors, if we can't achieve that (and I don't think we can without some major hacking) then softening the default red presentation seems like a good idea.
randomgambit commentedon Oct 17, 2018
amazing idea guys. You cant imagine how many times I missed that my code chunk actually didnt do anything because I didnt see that error line pop up among the output. Having errors in RED would be really useful!
breckuh commentedon Oct 30, 2018
This really would be amazing. Like @randomgambit mentioned, I often don't catch an error message because I've learned to ignore most red text in the console. I also waste time scanning through information searching for errors. This is my number 1 complaint about the UX in RStudio (Well, this is my number 2 complaint--my first complaint is that RStudio can't automatically fix my bugs, analyze my data for significant findings, and submit these findings to journals). Ignoring most of the red text in the console is very counter intuitive to anyone coming from another programming language.
The red is also very distracting in Jupyter. In the example below, my notebook looks like the Red Sea. In this example I know I could use "warn.conflicts" or "suppressPackageStartupMessages" to clean up the red, or click "hide outputs" everytime I run the cell, but adding ~4 tokens per line seems like a waste of effort to hide some red. I like to use "conflicted" to only alert me to an error when there potentially is one.
I think a convention around messages to stderr that could be parsed to format appropriately would be great. Or whatever you decide--I'm not familiar yet with the R/Rstudio internals.
UPDATE: I have since started playing with RMarkdown notebooks, which are awesome and have other ways of dealing with the red problems. But still, would be nice...
gtritchie commentedon Apr 19, 2019
Using color as the only way to communicate something in the UI is an accessibility no-no as it is invisible to screen readers, those with color-blindness, and so forth.
If we do something like this, we need to make sure the information is "visible" to screen readers, and to sighted users who can't distinguish colors. Flagging as a (potential) accessibility issue so this gets considered should we do some work on this.
katrinleinweber commentedon Mar 8, 2020
Please re-consider this in case of warnings. As an instructor to new R(studio) learners, I often get worried questions why this or that "didn't work" (e.g. installing packages on Windows without Rtools preset). Most often, checking what the problem could be reveals that they misinterpreted some red warning.
Yes, that's a good lesson in actually reading console output, but an unnecessary source of confusion. Orange would be neat :-)
daattali commentedon Jun 2, 2020
@gtritchie I think you bring up a very similar, but perhaps separate issue. Accessibility of the colours and getting information from the colours is one issue.
There is also another issue that is very important: currently messages are red, which means that for any sighted non-colour-blind beginner user, they think something went wrong. Simply removing all colour would even be a better alternative at the moment for this issue specifically. Every time I teach a new group of people R, a few of them tell me that everything is failing just because they see all the red messages and assume that red = fail. So I would argue this red messages issue needs to be addressed as a high priority because it is a deterrent to a majority of new users. The accessibility issue here should be addressed but I'd say is a separate issue.
38 remaining items
bbolker commentedon Mar 23, 2025
This has come up again here; still something people care about!
kevinushey commentedon Mar 23, 2025
FWIW that specific example (red text in the output of
install.packages()) wouldn't be entirely solved even if we had special handling for messages, as the output for package download is printed viaREprintf():https://github.com/wch/r-source/blob/d05acf513f567e330b5a56e8a933bcffba943694/src/modules/internet/libcurl.c#L790
(and elsewhere in that file).
It's obviously been a long time since this issue was first opened, but I would lean towards having stderr output unstyled by default, but perhaps only printed in red for error messages printed from uncaught errors?
kevinushey commentedon Apr 2, 2025
We now have some support for this in the daily builds of RStudio. These are available for testing from https://dailies.rstudio.com.
Rather than just adjust the highlight of messages, we now display them with a sort of "banner" display, with a similar treatment for warnings and errors. For example:
This behavior can be adjusted; e.g. if you'd like this display for only specific condition types, or if you'd like to disable it altogether and return to the previous RStudio behavior.
Feedback is definitely appreciated!
DesiQuintans commentedon Apr 3, 2025
Ohhhh this is nice!
The yellow Warning colour would be difficult to read with light themes.
This might be strange feedback, but would you consider either a Warning colour that is sort of neutral in connotation (e.g. brown), or perhaps a colour that's middlingly positive, like a yellow-green? I have always explained Warnings as, "Your code still worked, but there's something you should know about it, and that detail might be important or it might be no big deal." The yellow colour still signals "Slow down, something's wrong" to me.
kevinushey commentedon Apr 3, 2025
We use slightly different colours for the light theme (orange for warnings; red for errors).
The colours could probably still be tweaked a bit to further increase the contrast, though -- maybe also bolding the red / orange text?
That's great feedback -- I'll also raise this internally and see what others opinions are.
ronblum commentedon Apr 9, 2025
This is neat! But, "warning" seems to be misbehaving. This example uses the Crimon Editor theme:
For warnings, the output starts with "Warning message" and then the warning itself is on the next line. "Warning" isn't highlighted.
kevinushey commentedon Apr 9, 2025
This is expected; the format of warning messages will differ based on whether
options(warn = 0)is set oroptions(warn = 1)is set. I haveoptions(warn = 1)set in my.Rprofile, butoptions(warn = 0)is the default.I guess we could highlight the title "Warning message" in the second case?
ronblum commentedon Apr 14, 2025
OK--I'll open a separate issue in which to discuss whether or not to change color when
warn = 0.