Everyone working with binary in the terminal should be told about about stty sane. Very useful.
There is also reset(1).
Re:Curl doesn’t spew binary anymore
by deathanatos on Saturday June 17, 2017 @04:41PM
(#14577645)
My coworkers and I used curl, and the linux kernel, as part of interviews. The candidate was asked to download the source to the Linux kernel during the interview; occasionally they would curl it to the tty. (We don't ding them for this, as I do it all the time myself… In fact, if anything, it provides a great opportunity to see if they know about reset, or the details of their mistake (e.g., why did that have so many odd effects on the terminal? why did the title change? etc.)) Surprisingly, the binary output would screw up tmux beyond repair by reset. (There would be characters printed outside the "terminal"'s area, for example. We suspect tmux has a few bugs because of this.)
Re:Curl doesn’t spew binary anymore
by fiddlerwoaroof on Saturday June 17, 2017 @06:33PM
(#14578030)
Fuzzing tmux's terminal would probably lead to some interesting bugs.
Which could mess up your terminal, so curl is doing the right thing.
> UTF-Encoding
On Unix, terminals would be completely broken if they used UTF-16. Other Unicode Transmission Formats don't use null bytes.
> special use cases
Such as?
> In fact, I run into this problem with grep from time to time and it is super annoying:
That's not applicable here, because grep only prints parts of the file, while curl prints out the whole file.