python command mis-interprets arrow keys

R

Rahul

My python command line seems messed up. I can't seem to be able to use my
backspace key nor my arrow keys.

I only get control characters: ^[[A^[[D^[[D^[[D^[[C^[[C^[[C etc.

I access my Linux box via a SecureCRT console. Only after opening the
python interpreter does this occur. Linux command like is OK. vim
interprets keystrokes correctly. So do other interpreters e.g. gnuplot.

$LANG $TERM
en_US xterm-color

Versions:
Python 2.4.4
GCC 4.1.2 20070925 (Red Hat 4.1.2-33)


Any sugesstions? Google did not throw anything relevant.
 
D

Diez B. Roggisch

Rahul said:
My python command line seems messed up. I can't seem to be able to use my
backspace key nor my arrow keys.

I only get control characters: ^[[A^[[D^[[D^[[D^[[C^[[C^[[C etc.

I access my Linux box via a SecureCRT console. Only after opening the
python interpreter does this occur. Linux command like is OK. vim
interprets keystrokes correctly. So do other interpreters e.g. gnuplot.

$LANG $TERM
en_US xterm-color

Versions:
Python 2.4.4
GCC 4.1.2 20070925 (Red Hat 4.1.2-33)


Any sugesstions? Google did not throw anything relevant.

Is libreadline installed?

Diez
 
R

Rahul

Is libreadline installed?

Thanks for your help Diez. I did a locate and found:

/usr/lib/libreadline.a
/usr/lib/libreadline.so
/usr/lib/libreadline.so.5
/usr/lib/libreadline.so.5.1
/usr/local/src/Python-2.4.4/Doc/lib/libreadline.tex

Any better way to check?
 
D

Diez B. Roggisch

Rahul said:
Thanks for your help Diez. I did a locate and found:

/usr/lib/libreadline.a
/usr/lib/libreadline.so
/usr/lib/libreadline.so.5
/usr/lib/libreadline.so.5.1
/usr/local/src/Python-2.4.4/Doc/lib/libreadline.tex

Any better way to check?

The question is if python is build with readline support. Did the python
version work before, and somehow got messed up, or did you build it
yourself and it never actually worked? If it's the latter case, you
might try & install a possible readline-dev-package (or whatever it is
called on red hat), and build again, cautiously monitoring if readline
is picked up from the build-process.

Diez
 
R

Rahul

The question is if python is build with readline support. Did the python
version work before, and somehow got messed up, or did you build it
yourself and it never actually worked?

I suspect we upgraded our RHEL and that broke it. Has never worked after.

Is there a way to extract what cmd-line options my python was compiled with?
Might be worth it before I go the long-painful route of re-installing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top