chalk/supports-color

support for NO_COLOR env var #105

pieh posted onGitHub

Would you accept PR adding support NO_COLOR env var as specified in https://no-color.org?

If so my only question would be which env var should win when both NO_COLOR and FORCE_COLOR would be defined? I suppose FORCE_COLOR should have priority given that it seems to be more established convention?


No, we've been asked this a bunch of times. This would add nothing; FORCE_COLOR is already a bit of a convention in the *nix world. We don't need 10 competing standards.

posted by Qix- over 5 years ago

This is a pity, since there is disagreement about the meaning of FORCE_COLOR=0. The site https://force-color.org/ specifies (emphasis added):

When this variable is present and not an empty string (regardless of its value), it should force the addition of ANSI color.

Other projects cite this page and refuse to implement FORCE_COLOR=0 to disable color. NO_COLOR would be unambiguous.

posted by pdewacht about 1 year ago

@Qix- isn't the object of this library to account for the emerging standards through it's stated mission of

Detect whether a terminal supports color

The existing implementation is effectively already an attempt to account for a number of community standards around color support declarations using environment variables, of which NO_COLOR is simply another one to add?

posted by dcousens about 1 year ago

There's no "standard" for any of this, and I don't see anywhere where we mention we'll add support for any idea that comes along.

posted by Qix- about 1 year ago

This would add nothing...

This would add something I believe, since: - https://no-color.org/; - Symfony and Laravel PHP frameworks use the env. variable for VarDumper; - Node supports it even too.

posted by artshade 9 months ago

Fund this Issue

$0.00
Funded

Pull requests