Chalk icon indicating copy to clipboard operation
Chalk copied to clipboard

Detecting non-interactive terminals

Open mickeyl opened this issue 2 years ago • 2 comments

I've been previously using a competitor's project that detects the terminal type and can transparently turn off color and style coding when it encounters a non-interactive one (e.g., file redirection).

Since I like the Chalk API much better, it would be cool, if it could do something equivalent.

mickeyl avatar Feb 20 '22 10:02 mickeyl

I believe I originally considered this “out of scope” but let’s face it, there needs to be an easy way to do this.

Not sure about how it should work though.

mxcl avatar Feb 25 '22 15:02 mxcl

How about this one https://github.com/mxcl/Chalk/pull/7 ?

mickeyl avatar Feb 26 '22 10:02 mickeyl