Hacker News new | ask | show | jobs
by kazinator 3700 days ago
This could be done with a single VT100 escape: print multi-line junk, move the cursor back, print less junky junk, repeat.

(Even with some optimization: for any line that is not changing any more, just emit a CR-LF).

You don't even need to put the TTY into raw mode; no termios calls needed, and \n is your CR-LF.

1 comments

If you have a better implementation, ship it. Don't trash someone else's work from the sidelines.

edit: OP removed the snark from the comment.

Specifically, I removed the text "Seriously?"
Oooh, good one! Do I have your permission to use it in the code review I'm going into in 30 minutes?
If you were releasing your tool to the reviewer free of charge, absolutely.