Keyboard problems with Python shell over SSH

Stian Soiland stian at soiland.no
Sun Jan 23 16:36:56 EST 2005


På 23. jan 2005 kl. 21:55 skrev Nils Emil P.Larsen:
>
> I connect to my server using SSH and then run 'python' to enter the
> shell.  I can't use the arrow buttons (up, down, left and right).
> Instead I get this ^[[A , ^[[B,  ^[[C or  ^[[D.

Your Python installation is probably compiled without readline support. 
It is the readline library that enables arrow keys and Ctrl-R and stuff 
to work.

Try "import readline" - you will probably get an error.

I won't go into detail on how to install readline on your OS. In 
Linuxes, it might be apt-get install readline-dev. In other OSes, 
different licensing and packaging issues might have prevented 
readline's precense.


-- -- 
Stian Søiland               You can't say civilization don't
Trondheim, Norway           advance, however, for in every war
http://www.soiland.no/      they kill you in a new way. [Rogers]
                      =/\=




More information about the Python-list mailing list