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

Support for NO_COLOR proposal #1498

Closed
seebi opened this issue Mar 11, 2020 · 2 comments
Closed

Support for NO_COLOR proposal #1498

seebi opened this issue Mar 11, 2020 · 2 comments

Comments

@seebi
Copy link

seebi commented Mar 11, 2020

Expected Behavior

As described at https://no-color.org/, setting NO_COLOR to any value should disable color output at all.

Actual Behavior

Every application need its own solution for color disabling.

I think this behavior should be added to Click itself because its a reasonable default.

@jcrotts
Copy link
Contributor

jcrotts commented Mar 20, 2020

See this issue for discussion on a similar request.
This may have more of a rationale behind it, but in general I don't think click benefits from this sort of customization.

@davidism
Copy link
Member

davidism commented Apr 13, 2020

I find myself agreeing with ggreer/the_silver_searcher#1207 (comment), which is linked from the page you linked. It's not clear that this standard is a standard or that it's the correct thing to do.

As Jay points out, this has already been discussed in #1090 and we reached similar conclusions then. If an application wants to support controlling the color with an env var, it's straightforward to add.

if __name__ == "__main__":
    color = os.environ.get("CLICK_COLOR")
    color = color in {"1", "true"} if color is not None else None
    cli(color=color)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants