-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Support forcing colors #17229
Comments
Also open to making the actual change if this is something wanted, just don't know which behavior is preferred. |
If we were to support it, it should be via env var. Is there a prior art for |
Prior art for
More approaches:
I do not have any strong preference on the approach here |
@dsherret thoughts on this one? |
We should probably do exactly what Node does, so go with FORCE_COLOR. It defaults to Environment variable sounds much better than a flag. |
Seems like the lib Would replicating the logic of what is "enabled" for the flags be enough or should the it support the concept of color depth as well? |
I think for compatibility with Node we should get it to work the same way, so maybe that means using a different crate or implementing this ourselves. As a stepping stone, we could maybe implement this broken for now with the same API as Node then fix it up later. |
this would be beneficial to allow forcing color to be enabled in ci like github actions which arent tty but still can show colors related: pypa/pip#10909 Textualize/rich#2425 wntrblm/nox#502 python-poetry/cleo#341 astral-sh/ruff#5499 dotnet/command-line-api#1710 pre-commit/pre-commit#2918 pytest-dev/pytest#7443 python/mypy#13806 |
Also the extremely useful case of piping to |
If deno is not running in a tty there is currently no way to override it so that colors are shown
deno/runtime/js/99_main.js
Line 250 in 98bbf87
Some options are:
FORCE_COLOR
env var - this would ignore the other values and never setnoColor
--color
flag - similar tols
and other CLI utilsauto
-> current behaviornever
-> same behavior asNO_COLOR
always
-> force color onThe text was updated successfully, but these errors were encountered: