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

Suggestion: supporting NO_COLOR environment variable #268

Open
Ptival opened this issue Jul 23, 2020 · 4 comments
Open

Suggestion: supporting NO_COLOR environment variable #268

Ptival opened this issue Jul 23, 2020 · 4 comments
Labels
0.4.5 Get merged for 0.4.5 release

Comments

@Ptival
Copy link

Ptival commented Jul 23, 2020

While color is great when you want it, it can be annoying when you don't.

https://no-color.org/

This manifesto suggests supporting a NO_COLOR environment variable that disables all color codes when set.

I think it'd be neat to officially support it.

@mylesbartlett72
Copy link

This could be as simple as an option for colorama to "do nothing" and let scripts use os.getenv, although I don't see why it would be too hard for colorama to add in support.

@tartley
Copy link
Owner

tartley commented Oct 7, 2021

There is a languishing PR, which I aim to merge imminently... #230

@tartley tartley added the 0.4.5 Get merged for 0.4.5 release label Oct 7, 2021
@thetasine
Copy link

thetasine commented Nov 18, 2021

I implemented this in 5 seconds under Windows:

if os.getenv('NO_COLOR'):
        colorama.init(strip=True, convert=False)       

@nocnokneo
Copy link

Similarly for FORCE_COLOR and/or CLICOLOR_FORCE

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

No branches or pull requests

5 participants