News for hackers. Stuff that matters.
Re:Show HN: Zli – A Batteries-Included CLI Framework for Zig by quotemstr on Sunday May 25, 2025 @04:16PM (#44090698)
Except all those times you don't want color at all.
Re:Show HN: Zli – A Batteries-Included CLI Framework for Zig by arp242 on Sunday May 25, 2025 @05:00PM (#44091080)
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.

Re:Show HN: Zli – A Batteries-Included CLI Framework for Zig by quotemstr on Sunday May 25, 2025 @05:26PM (#44091296)
NO_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.
Re:Show HN: Zli – A Batteries-Included CLI Framework for Zig by arp242 on Sunday May 25, 2025 @05:38PM (#44091417)
> 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.