Skip to content

Using multiple environment variables is not nice. #19

Open
@de-vri-es

Description

@de-vri-es

A single environment variable is much easier to use. You don't need to worry about other conflicting environment variables being set already. Just update the one variable to your desired value, and poof.

I would suggest the following:

  • COLOR=false/no/0 means don't output color codes.
  • COLOR=true/yes/1 means output color codes.
  • COLOR=auto means output color codes only if output is going to a terminal.
  • COLOR= (empty) means the same as not set, no explicit choice was made. Applications should be encouraged to fall back to CLICOLOR, CLICOLOR_FORCE and NO_COLOR. But they could also just default to COLOR=auto.

Unrecognized values are treated the same as an unset environment variable (they are ignored).

Its more complicated to support all the different truthy/falsy values, but I believe it would match user expectations quite well. For maximum niceness for users, the comparison should probably be case insensitive too.

For backwards compatibility, the specification should indicate to ignore CLICOLOR, NO_COLOR and CLICOLOR_FORCE if COLOR variable is set and not empty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions