2 ms·
I hope you at least skip the escape sequences when TERM=dumb. There are plenty of circumstances where a tool is run in an environment with no terminal or termin
by db48x 3y ago
I hope you at least skip the escape sequences when TERM=dumb. There are plenty of circumstances where a tool is run in an environment with no terminal or terminal emulation available, and it always annoys me to see useless escape sequences sprinkled all over in those cases.
- kazinator 3y agoMy preferred design solution is: - no escape sequences unless both standard input and output are a TTY; - have a "plain mode" option which disables the fancy terminal control even if standard input and output are a TTY. I think the kind of system where you don't have terminal emulation is not going to have environment variables. But even tiny embedded systems with kilobyte memories can connect to serial lines with a terminal emulator on the other end. They won't have one built-in, needless to say.
- db48x 3y ago> I think the kind of system where you don't have terminal emulation is not going to have environment variables. This is quite wrong. The output could just be going to a log file, or to a window in your editor instead of to a terminal.
- DonHopkins 3y agoColor changing escape codes in build and server logs are so obnoxious. And also progress reports using cursor motion, like pulling multiple docker layers in parallel, that hyperactivity update a hundred times a second. Docker has a -progress=plain parameter that at least suppresses the cursor motion, but it still spams the logs ridiculously, and google cloudbuild and server logs don't use it. I bet cloud providers make millions of dollars charging their customers to log and store that kind of voluminous worthless crap. And then I have to spend hours every month slowly scrolling through that crap page by page to traverse the server and cloudbuild logs just to see what happened after docker containers finally downloaded.