-
Notifications
You must be signed in to change notification settings - Fork 46
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
Colors are always enabled in CI, even when output is piped #41
Comments
Just for the context. GitHub Actions has broken TTY detection. CI supports colors, but report lack of TTY. But I am not sure about the best solution here. |
I see now. Upstream issue is here. I'd like to have color on a test script on GH Actions too, I just don't want color on every child process that it starts and internally reads the output of. $ node -e "console.log(require('picocolors').isColorSupported)" | cat
false
$ CI=1 node -e "console.log(require('picocolors').isColorSupported)" | cat
true Other CI services that also set I think we should either;
|
Oh. |
I worked around this by using |
We're experiencing this too, see netlify/cli#4354 (comment) in case a reproduction is needed. |
I wrote a program that uses this module. The tests pass on my local machine (because the colours are sensibly disabled when the program's output is piped), but they fail in CI, because this line turns colours on no matter what if
process.env.CI
is set. Even if it's not in a TTY.When stdout is not a TTY, I think colour should always be disabled, unless it's specifically forced on with
FORCE_COLOR
.The text was updated successfully, but these errors were encountered: