3 ms·
I agree that an env variable would be "philosophically" the right thing to do ("no colors" is a user choice and programs should respect user choices). However,
by xg15 5y ago
I agree that an env variable would be "philosophically" the right thing to do ("no colors" is a user choice and programs should respect user choices).
However, giving a standard enough momentum so that most developers will actually implement it is an incredibly hard thing to do. I honestly don't have much hope that this will reach enough projects to be practically usable. At least not without support/enforcement by distributions.
I also think that modifying shells instead could be a more pragmatic and effective solution - simply because there are less people you'd need to convince.
You could get the same outcome however by having the shell interpret the NO_COLOR variable and have it strip colors from each subprocess where it is set.
Also, I believe, most programs automatically disable colors when they detect that STDOUT does not point to a terminal. So couldn't you have the same effect by simply appending "| cat" to your command?