top | item 30486530

(no title)

obeattie | 4 years ago

Without understanding the minutiae of this, couldn’t someone just write a program that we can pipe any output to, which strips colour commands from its input before writing it back out? Does such a program already exist? That wouldn’t require every program to add support for an environment variable.

discuss

order

tgv|4 years ago

Often, `cat` will do that. Many tools look at stdout to see if it's a terminal. When it isn't, they suppress color output.

lexicality|4 years ago

By itself, less will prevent any control sequences (including colours) from actually being sent to the terminal, but most distros seem to have -R set on it by default these days. If you unset -R it'll do exactly that.