3 ms·
NO_COLOR exists, and is fairly widely supported. TERM=dumb to disable colour was always a hack at best because this also disables other things like "clear line"
by arp242 1y ago
NO_COLOR exists, and is fairly widely supported. TERM=dumb to disable colour was always a hack at best because this also disables other things like "clear line" and generally leads to weird output.
> It's a Chesterton's fence.
It's not. The world has changed. Everyone uses \x1b[1m to make text bold today but in the past there were a few dozen ways from different vendors of (hardware) terminals to make text bold. But this situation no longer exists. Like I already said: you still need it for some things – there's a reason I compiled a "safe terminal escape code" list. But for many things you don't.
- quotemstr 1y agoNO_COLOR is far from universally supported (even people who bother to check TERM don't know about it) and typically isn't configured to pass through sudo or ssh.
- arp242 1y ago> NO_COLOR is far from universally supported I never claimed that. The sudo or ssh configuration is up to you. Or else there's |cat, which often works when NO_COLOR doesn't. Either way, terminfo was never intended to allow users to disable colours. Certainly not via TERM=dumb – that was always a hack. If you want to disable colours then there are better ways.