3 ms·
That's kind of what aliases are for.
by Beltalowda 4y ago
That's kind of what aliases are for.
- bombolo 4y agoThat's exactly the poor programming I was referring to. Call isatty()!
- Beltalowda 4y agoThe downside of that is that piping to less won't display colours any more either, so then you need "progname -color=always" or some such. Some programs solve that with a built-in "pipe to terminal" feature, but I always find that a bit annoying. I don't know anything about terraform, but I've written some applications where I intentionally don't automatically change the output (which in my case is usually bold text, I don't use colours much) because I expect no one will ever use the output for scripting . That's not "poor programming", it's a choice because there is no perfect solution that fits 100% of the cases. I suspect that may probably be the best choice for terraform as well, but I never used it.
- bombolo 4y agoBut piping to less would display the escape codes, not the colours anyway… which is why this is done. Imagine grep not working because in between the words that you are searching there is an escape code.
- Beltalowda 4y agoThat depends on the settings used for less; AFAIK the default for many distros is to display control characters.