Skip to content
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

Add support for NO_COLOR environment variable #1207

Closed
wants to merge 1 commit into from

Conversation

AbstractBeliefs
Copy link

When the NO_COLOR environment variable is present (with any value), disable
colour output. This can be overrident explicitly with the --color switch.

See also: http://no-color.org/

When the NO_COLOR environment variable is present (with any value), disable
colour output. This can be overrident explicitly with the `--color` switch.

See also: http://no-color.org/
@AbstractBeliefs
Copy link
Author

AbstractBeliefs commented Jan 26, 2018

There's unfortunately no test for this: the test environment has colour suppression due to the tty detection, and because of this all colour tests have the --color switch, overriding the environment variable.

A test could be implemented by removing the --color switch and disabling tty detection with another new switch, but I'm not sure this is a helpful path to go down.

@ggreer ggreer closed this Jun 7, 2018
@ggreer
Copy link
Owner

ggreer commented Jun 7, 2018

I don't mean to annoy you by closing this. It's just that we seem to disagree on the usefulness of this feature. People can read my reasons here: https://news.ycombinator.com/item?id=17244313

Sorry.

@kikonen
Copy link

kikonen commented Jun 1, 2022

I surely would have liked that also this tool would have simply conformed to NO_COLOR, instead of needing to extra tricks for this case :()

Thus

alias ag="ag --nocolor"

it is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants