Though most of the software do the right thing by checking if the standard output is an actual tty (isatty) to avoid colors when redirecting to something else (e.g. socket, fifo, etc).
The name NO_COLOR suggests a really binary choice which may be okay. Though GNU coreutils usually have a more selective option like --color=always|auto|never.
I'd prefer supporting a more general COLORS=on|off|compatible|...
Meaning:
- on: always on even when redirecting
- off: fully off
- compatible: maybe something like on by default and off if redirecting to a non-tty
Hmm, why not.
Though most of the software do the right thing by checking if the standard output is an actual tty (isatty) to avoid colors when redirecting to something else (e.g. socket, fifo, etc).
The name NO_COLOR suggests a really binary choice which may be okay. Though GNU coreutils usually have a more selective option like --color=always|auto|never.
I'd prefer supporting a more general COLORS=on|off|compatible|...
Meaning:
- on: always on even when redirecting
- off: fully off
- compatible: maybe something like on by default and off if redirecting to a non-tty
- ...: add more choices