top | item 34384078

(no title)

Beltalowda | 3 years ago

That's kind of what aliases are for.

discuss

order

bombolo|3 years ago

That's exactly the poor programming I was referring to.

Call isatty()!

Beltalowda|3 years ago

The 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.