Fixing a misbehaving terminal after after software interruption (pdb) or messed up output

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+

5 thoughts on “Fixing a misbehaving terminal after after software interruption (pdb) or messed up output

  1. 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 :)].

  2. 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?

  3. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *