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

respect the NO_COLOR specification #10548

Closed
gasche opened this issue Aug 1, 2021 · 2 comments · Fixed by #10560
Closed

respect the NO_COLOR specification #10548

gasche opened this issue Aug 1, 2021 · 2 comments · Fixed by #10560

Comments

@gasche
Copy link
Member

gasche commented Aug 1, 2021

Some people on the interest have decided to agree on an informal specification: if a NO_COLOR variable is defined in the user environment, then terminal tools should not enable colors by default (only if explicitly requested). The OCaml compiler shows colors by default in its error/warning messages, with various heuristics and configuration mechanisms to disable or refine it. It would be nice to respect the NO_COLOR specification.

More details: https://no-color.org/

@dbuenzli
Copy link
Contributor

dbuenzli commented Aug 1, 2021

Is that a good specification though ?

I think the current tri-state value never, always, auto of OCAML_COLOR is what you want to be able to specify in practice (e.g. you want to be able to force colored output for cram testing). I wish they had standardized a COLOR variable that way.

If you want to proceed, what takes precedence when both variables are present ? I'd personally say the most specific i.e. OCAML_COLOR.

@gasche
Copy link
Member Author

gasche commented Aug 1, 2021

The webpage says:

User-level configuration files and per-instance command-line arguments should override $NO_COLOR. A user should be able to export $NO_COLOR in their shell configuration file as a default, but configure a specific program in its configuration file to specifically enable color.

I believe that, by the same reasoning, the more specific OCAML_COLOR should take precedence when it is specified, indeed.

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

Successfully merging a pull request may close this issue.

2 participants