-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Consider supporting FORCE_COLOR environmental variable #71
Comments
The problem is that there are multiple answers to this. For example, #41. And in practice, I'm not sure I really think the goal of "having one true way to force colors for applications" is probably just not going to happen unfortunately. I resisted #41 because I don't really want to be in the business of just supporting a bunch of different random environment variables. I for example wonder whether it was right to add |
Yeah, it does seem that at this point this is just a "random environment variable". The momentum in the python ecosystem seems strong and recent though, so I wouldn't be surprised if this ends up a standard in the future, but it's wrong for |
For posterity, good recent summary of the state of things in this area: hashicorp/terraform#23708 (comment) |
Yeah... I would have said that about And the terraform folks hit the same issue I had when considering whether to add more environment variables: how do they interact with one another? Which one wins? |
This is more of a braindump rather than a well-considered feature request, as I am not an expert in the domain. The TL;DR is that there's
FORCE_COLOR
env variable, which is the opposite ofNO_COLOR
, and it might be nice to support it.Background: I am writing a thing which spawns other processes (like
cargo
) viastd::process::Command
. The thing is definitely not a terminal emulator, so the subprocess stdout is normal pipe, rather than a TTY. My thing is also capable of parsing ANSI escapes, so it would very much like to receive colored output from subprocess. I wold love to have a general, cross-platform way to tell subprocesses "give me ANSI colors!" and I would love this not involving ioctl to the kernel (the way ttys work). TheFORCE_COLOR
feels like this solution.However, there's a problem: unlike
NO_COLOR
,FORCE_COLOR
isn't a "real standard". I think this is just a thing thatnode
is doing. However, it seems like it at least becomes a de-facto standard. See, for example, the list of references in python/mypy#13806 (but, of course, node and python interpret this value differently:FORCE_COLOR=0
force-disables colors for node, and force-enables colors for Python).The text was updated successfully, but these errors were encountered: