84

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.
dctucker
  • 679
  • 5
  • 12
LittleBobbyTables
  • 4,361
  • 9
  • 38
  • 67
  • [This answer](http://stackoverflow.com/a/15795658/564764) on a similar thread worked for me. – JRS Feb 22 '16 at 21:38

6 Answers6

180

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

olvlvl
  • 2,396
  • 1
  • 22
  • 22
11

I've found that specifying "The Function Keys and Keypad" option to match your operating system resolves many issues.

[Putty]

Terminal -> Keyboard --> RadioButton "Linux"

(if you're using Linux) and then you can start your session

Mike Cameron
  • 169
  • 1
  • 10
4

You could try changing the 'Application Cursor Keys' mode. It's in the Terminal->Keyboard subsection of the initial configuration window (these settings may potenitally be overridden by your server).

http://the.earth.li/~sgtatham/putty/0.55/htmldoc/Chapter4.html#S4.4.4

paul
  • 21,653
  • 1
  • 53
  • 54
  • as I mentioned **these settings may potentially be overridden by your server** - might anything have changed there? – paul Feb 12 '13 at 16:50
  • I'm not sure. I think it may be an error in python or the codecs module. See my Edit 3 - does this bug happen for you too? – LittleBobbyTables Feb 12 '13 at 16:58
  • 1
    Nope, I did have a similar problem though. The settings in putty config fixed it for me. – paul Feb 12 '13 at 17:01
  • 1
    Windows 10 PuTTY to locally-hosted FreeBSD VM, arrow key was on wrong line and cursor position wonky, changing this ("Initial state of cursor keys" from "normal" to "application") fixed it for me. Thanks Paul. – Kevin_Kinsey Apr 24 '18 at 16:32
4

Just run the simple bash command or sudo bash in ssh. It usually works.

Ahmad.S
  • 779
  • 6
  • 25
1

For those interested in the issue, had same simptoms in a virtualenvironment, resolved the issue with

pip install readlines

See following answer for details.

Community
  • 1
  • 1
latheiere
  • 451
  • 4
  • 14
  • Interestingly, this weird problem exists ONLY for Ruby eval prompt on Redhat (RHEL). I executed the command for python 2.6.6 and followed by the error message `Could not find any downloads that satisfy the requirement readlines` and `No distributions at all found for readlines`. – Ivan Chau Jan 03 '14 at 09:39
1

Terminal >>> Local line editing >>> Force off

See also