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

Clarify behavior of empty CLICOLOR and CLICOLOR_FORCE #8

Closed
bradking opened this issue May 6, 2021 · 4 comments
Closed

Clarify behavior of empty CLICOLOR and CLICOLOR_FORCE #8

bradking opened this issue May 6, 2021 · 4 comments

Comments

@bradking
Copy link

bradking commented May 6, 2021

The specification does not currently say anything about semantics for CLICOLOR= and CLICOLOR_FORCE=. The example code for CLICOLOR_FORCE implies that CLICOLOR_FORCE= should be equivalent to CLICOLOR_FORCE=1, but IMO that is confusing. An empty setting should be equivalent to no setting at all.

@jhasse
Copy link
Owner

jhasse commented May 6, 2021

I would prefer empty meaning "unset", too. Unfortunately that's not how Apple implemented it :(
image
Apple is probably the biggest supporter of this "spec". Maybe we can ask them somehow? Or just clarify the documentation.

@bradking
Copy link
Author

bradking commented May 6, 2021

I suggest we update the documentation to state that behavior for the empty case is unspecified so that tools can do either and users are encouraged to always set it with 0 or 1 explicitly.

@mawillers
Copy link

[...] behavior for the empty case is unspecified [...]

Would be fine for me.

$ CLICOLOR_FORCE=0 ls | cat
[colored output]

Apple is really ignoring the value of that variable altogether? That goes quite against the whole idea...

@lionkor
Copy link

lionkor commented Aug 5, 2022

Hate to be that guy, especially after this long, but CLICOLOR_FORCE was only ever meant to force ENABLE colors, not force DISABLE colors. It exists because while CLICOLOR enables colors, it should still not output any colors if the output is not a TTY. Therefore, _FORCE was invented.

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

No branches or pull requests

4 participants