-
-
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
Respect $NO_COLOR variable #13
Comments
Having the discussion spread across two issues is really confusing. So I'm going to copy the comments from BurntSushi/ripgrep#1186 into here: I think I'm OK with this in principle. It should be implemented in I think I've historically not done this because it's not clear to me how widespread Thanks, and sorry for not doing my research. I suspected ripgrep to use some library for colored terminal output and that would obviously be the better place to implement this. I've opened #13. |
I do. If it doesn't garner wide appeal, then we're likely stuck with it forever. Once you add support for something like this, it is very difficult to remove. Of course, there is a chicken and egg problem here. Part of my hesitation to do this is that there has been a long time work around to this, which is to set |
Ok, I get what you are saying. So let's just leave this issue around and see, if there is enough demand? People in support of the issue can just use the 👍 reaction on the issue to express their interest. |
I added support for this in #24. The next release of ripgrep should have this as well. It's currently on master: BurntSushi/ripgrep@5a6e17f |
The NO_COLOR environment variable should only be honoured if the value is not empty. This means ‘export NO_COLOR=’ (or equivalent) can be used to enable color again, which is useful in environments where env vars can be added, but not unset, e.g. CI systems supporting env vars in YAML config files. Quoting the informal ‘spec’: > Command-line software which adds ANSI color to its output by default > should check for a NO_COLOR environment variable that, when present > and not an empty string (regardless of its value), prevents the > addition of ANSI color. – https://no-color.org/ See also BurntSushi#13.
It would be cool for termcolor to respect the NO_COLOR "standard", i.e. when
$NO_COLOR
is set, termcolor should not colorize the output, at least in auto mode. See https://no-color.orgThe text was updated successfully, but these errors were encountered: