Stop nano skipping characters in Lion's Terminal

Since using Terminal.app in Lion 10.7(.2), I've noticed some strange behaviour when editing files through SSH.

I use nano on the command line to tweak config files on remote servers and the strange behaviours have included:

  • Characters randomly not registering after the keypress
  • Backspace sometimes not deleting a character
  • Characters deleting but not showing visually as deleted
  • Insert and overwrite randomly switching places

Thanks to this short blog post, it's now fixed, here's how:

  1. Go to Terminal's preferences pane and click the 'Advanced' tab
  2. Change the 'Declare terminal as:' drop-down to: xterm-color

Save, restart and reconnect and you should find nano works perfectly.