-
Notifications
You must be signed in to change notification settings - Fork 70
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
Output colored red in callr::r()
#467
Comments
cli uses message() which outputs to the standard error, and RStudio colours the standard error red. When not using callr, cli figures out that it is in RStudio, so it outputs to the standard output to avoid this. But in the callr subprocess we have no way to tell if the output will be eventually in RStudio or not, so we cannot do that. So there is not much we can do about this, apart from hoping that the red default will change. |
Oh, I see. Thank you for the clarification. I have a follow-up question though: Is there a way to configure cli to use stdout instead of stderr, then? |
cli uses |
I also see the red text executing |
I can remove the red if I redirect tmp <- callr::r(
\() {
options(cli.color = TRUE)
cli::cli_alert_success('abc')
},
show = TRUE,
stderr = "2>&1"
) ✔ abc I am using |
When using
cli::
functions inside acallr::r
invocation, output is always colored red (first noticed this using W Landau'stargets
package).I'm not really sure this is even
cli
's fault, but I'm not experienced enought to debug this on my own.Here's a screenshot of the problem:
The text was updated successfully, but these errors were encountered: