I've been using the PuTTY terminal emulator for years, mainly with bash on Linux, and occasionally I'll do something which upsets the screen a bit, e.g. when I display some "unprintable" characters. You may be able to reproduce this problem with a command like this:
perl -e 'print chr(rand(256)) for 0..9999'
(Notice also how that messes up the wording on PuTTY's title bar. Why does that happen?)
After that, when I press up-arrow in the bash command line, to edit/reuse a previous command (especially those which are longer than one physical line long), and try to edit them (e.g. press left-arrow to take me back to the 50th character), things get messed up. The only resolution I've had so far is to start another session, because the following don't seem to help:
- The Linux "stty sane" command.
- The Linux "reset" command.
- The Linux "clear" command.
- The PuTTY "Reset Terminal" menu option.
Any proper solutions for when this problem happens?
I'm using PuTTY 0.52 on Windows.