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

Respect $NO_COLOR variable #1186

Closed
Sohalt opened this issue Feb 4, 2019 · 3 comments · Fixed by sthagen/BurntSushi-ripgrep#2
Closed

Respect $NO_COLOR variable #1186

Sohalt opened this issue Feb 4, 2019 · 3 comments · Fixed by sthagen/BurntSushi-ripgrep#2
Labels
enhancement An enhancement to the functionality of the software. question An issue that is lacking clarity on one or more points.

Comments

@Sohalt
Copy link

Sohalt commented Feb 4, 2019

It would be cool for ripgrep to respect the NO_COLOR "standard", i.e. when $NO_COLOR is set, ripgrep should not colorize the output. See https://no-color.org

@BurntSushi
Copy link
Owner

I think I'm OK with this in principle. It should be implemented in termcolor as parts of its "auto" mode.

I think I've historically not done this because it's not clear to me how widespread NO_COLOR usage actually is.

@BurntSushi BurntSushi added enhancement An enhancement to the functionality of the software. question An issue that is lacking clarity on one or more points. labels Feb 4, 2019
@Sohalt
Copy link
Author

Sohalt commented Feb 4, 2019

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 BurntSushi/termcolor#13.
As for how widespread NO_COLOR usage is, I can't really say, but I don't see a big downside to not implementing it. The variable name is fairly specific and even if it is set, one can override it, i.e. turn on colors, on a per program basis.
You can probably close this issue, since it needs to be implemented in termcolor and the change will eventually show up in ripgrep, when dependencies are updated.

@BurntSushi
Copy link
Owner

Please take further discussion to BurntSushi/termcolor#13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement to the functionality of the software. question An issue that is lacking clarity on one or more points.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants