3 ms·
> Software errors Which could mess up your terminal, so curl is doing the right thing. > UTF-Encoding On Unix, terminals would be completely broken if they u
by pcwalton 9y ago
> Software errors
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.
- nitrogen 9y agoEveryone working with binary in the terminal should be told about about stty sane. Very useful.
- lloeki 9y agoThere is also reset(1). https://linux.die.net/man/1/reset https://linux.die.net/man/1/reset
- deathanatos 9y agoMy 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.)
- fiddlerwoaroof 9y agoFuzzing tmux's terminal would probably lead to some interesting bugs.