Add support for opting out of ANSI coloring via NO_COLOR env. variable
See original GitHub issueCake is able to detect if ANSI coloring is supported in a number of cases, but once it detects that color is supported, there’s no way of opting out of it at the moment.
Some ideas:
- Check for the existence of an environment variable (
NO_COLOR
seems to be a standard) to opt out of ANSI coloring - Add a new command-line switch e.g.
--no-color
and/or--color=false
to opt out of ANSI coloring
Common options used to determine if ANSI coloring should be disabled used by some apps on GitHub:
-
Command-line arguments:
--no-color
--no-colors
--color=false
--color=never
-
Environment variables:
TERM=dumb
FORCE_COLOR=false
FORCE_COLOR=0
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
NO_COLOR: disabling ANSI color output by default
Software Description Date / Version Supported
alogview Android logcat Filter 2018‑10‑31
Ammonite Scala Scripting 2017‑07‑03 / 1.0.0
Ansible IT automation system 2021‑04‑26 / 2.11.0
Read more >No_color
NO_COLOR is a hint to the software running in the terminal to suppress addition of color, not to the terminal to prevent any...
Read more >Removing colors from output - bash
I have some script that produces output with colors and I need to remove the ANSI codes. #!/bin/bash exec > >(tee log) #...
Read more >a proposal to disable ANSI colors in a uniform way
NO_COLOR is a hint to the software running in the terminal to suppress addition of color, not to the terminal to prevent any...
Read more >How to get coloured terminal over ssh? - command line
I am thinking I could have just added "|xterm" after "color" in the first line, or dug around and figure out why ssh...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pascalberger Makes sense to respect
NO_COLOR
since that’s a pretty common convention. Other than that, the rest could be done in Cake.Configuration should IMHO be possible as other configuration options through environment variable, configuration file and argument.
@patriksvensson Is this something which should be done in Spectre.CLI?