News for hackers. Stuff that matters.
Re:Ask HN: What do you love/hate about terminals? Would you ... by polygot on Wednesday December 27, 2017 @07:12AM (#16014294)
On the lines of "just working", it'd be cool to have a shell which if I could accidentally cat a binary file and not have the shell be completely in-operable or have to run this long archaic command to get it working again.

Maybe have something like "when I run the cat command, ignore all commands to the terminal until cat finishes".

Re:Ask HN: What do you love/hate about terminals? Would you ... by JdeBP on Wednesday December 27, 2017 @09:13AM (#16014824)
Two errors there.

1. "reset" is six keypresses long, seven if you use the Control+J approach (although terminal control codes do not affect the line discipline and won't by themselves upset the newline settings of the line discipline in the first place), and not really archaic or long. On many terminal emulators, there is a menu option on the emulator that does the very same thing.

2. The mosh people addressed this problem years ago, and made a lot of noise about doing so. It's mainly a matter of just not supporting the old ISO/IEC 2022 control sequences for changing 7-bit character sets. See https://news.ycombinator.com/item?id=13904008 for more.

Re:Ask HN: What do you love/hate about terminals? Would you ... by terminal-survey on Wednesday December 27, 2017 @07:32AM (#16014380)
Our draft already contains a command for "set terminal into ignore-escape-sequences mode". I added that last week when someone showed how to hide malicious code in "git diff" by using specifically crafted control sequences.
Re:Ask HN: What do you love/hate about terminals? Would you ... by joombaga on Wednesday December 27, 2017 @07:30AM (#16014367)
What long archaic command are you running? 'clear; reset' usually does it for me.
Re:Ask HN: What do you love/hate about terminals? Would you ... by polygot on Wednesday December 27, 2017 @07:33AM (#16014384)
Sometimes clear; reset works but other times I can't see what I'm typing, and so when I type it and hit enter it might clear the screen, sometimes it runs the command but the bash prompt is completely messed up. I use tmux a lot, so I usually use the reset code from this answer: https://unix.stackexchange.com/questions/49886/tmux-status-b...

stty sane; printf '\033k%s\033\\\033]2;%s\007' "`basename "$SHELL"`" "`uname -n`"; tput reset; tmux refresh