Arrow keys in Putty returning ^[[A ^[[D ^[[B instead of moving the cursor

LittleBobbyTables picture LittleBobbyTables · Feb 12, 2013 · Viewed 60.2k times · Source

Has anyone else ever had this error in PuTTy?

For example, pressing the Up Key now produces:

>>> ^[[A

Google doesn't let you search for special characters so I'm stumped at finding existing version of this problem.


EDIT:

So this happened after I pasted in some unicode (when, I think, the translation was already set to utf-8).

I've checked the Change Settings dialog box for different settings than my other open PuTTy windows, but the settings appear to be identical.

EDIT2:

This is fixed by restarting PuTTy, but still a nuisance.

EDIT3:

How to replicate the exact same bug:

  1. Open a putty terminal to a linux PC (I'm using RedHat)
  2. Open Python 2.7.* - using the command python2.7 (note: error does not appear in 2.6)
  3. import codecs
  4. Now use the arrow keys, and these bizarre characters appear.

Answer

olvlvl picture olvlvl · Jun 10, 2014

In my experience that's because "bash" is not running. Simply run "/bin/bash" to enjoy colors, history and more.