3 ms·Or simply detect when piped and leave the color out, as just about every sane cli tool does it.by digi_owl 8y agoOr simply detect when piped and leave the color out, as just about every sane cli tool does it.eeZah7Ux 8y agoSpot on. A good pattern is to autodetect what to do by default and yet allow forcing on/off (e.g. --color and --no-color)kchr 8y agoAgreed. It could be as simple as checking if there is a tty and whether or not we're inside a pipe.