Use coloring only when writing to streams on a TTY
Dear Dimitris,
thanks a stack for conceiving and maintaining colored
. We are using it successfully within grafana-wtf.
Now, Simon Malave told us through [1]:
Hi, I am using this tool and needed to export the output to a plain text file to upload it to a Jira issue. The text was bloated with special characters used to give colors to the terminal.
On this matter, I just discovered [2], which outlines a convention to set an environment variable NO_COLOR
to suppress ANSI output. Apparently, this already gets honored by a bunch of software out there.
So, I wanted to humbly ask if you see that would also make sense for the colored
package to support?
With kind regards, Andreas.
[1] https://github.com/panodata/grafana-wtf/issues/9
[2] https://no-color.org/