1. Preface
Your terminal on Linux or OSX may end up to a bad state.
- You cat a binary file to terminal
- You interrupt pdb or some other application reading lines in a bad way
2. Symptoms
- New lines don’t work
- You cannot see your own typing to terminal
- Backspace stops working
3. Fix
Type command
stty sane
This may fix some problems without needing to restart the terminal. More info.
Subscribe to RSS feed Follow me on Twitter Follow me on Facebook Follow me Google+
reset is another command for resetting the terminal to a sane state.
Or tset.
Great suggestions. ‘tset’ seems to work best for me; ‘reset’ clears the terminal output, and ‘stty sane’ puts the prompt at the end of the current line [and is harder to type when invisible :)].
Thanks for this. Finally I don’t have to close misbehaving terminals anymore. 🙂
Can anyone explain *what* exactly screws up terminals when some program decides to spill binary onto them?
As far as I remember it’s caused by the program changing its own keyboard mapping expectations and then crashing without changing them back to match the shell.