Hacker News new | ask | show | jobs
by lokedhs 2105 days ago
In addition to what you are saying, I'd also ask developers to not use escape sequences directly but instead use terminfo. It allows you to send the correct terminal sequences regardless of the type of terminal you use.

In particular, it allows your users to completely disable the highlights by using TERM=dumb.

Also, please check if the output is a tty (the isatty libc call) I don't know how many applications with fancy coloured output that looks completely broken when redirecting to a file.