Python shell interpreting delete key as tilde?

L

Leif K-Brooks

I'm running Python 2.3.5 and 2.4.1 under Debian Sarge. Instead of
deleting the character after the cursor, pressing my "delete" key in an
interactive Python window causes a system beep and inserts a tilde
character. This behavior occurs across all of the terminals I've tried
(xterm, Konsole, real Linux terminal), but does not occur when running
bash instead of python. Other Readline-provided functionality (moving
the cursor, history) seems to work fine.

The delete key was working fine in Python up until a few days ago, and I
don't remember making any changes that should have affected it.

If anyone knows what could be causing this problem, please explain. It's
driving me crazy!
 
F

Fredrik Lundh

Leif said:
I'm running Python 2.3.5 and 2.4.1 under Debian Sarge. Instead of
deleting the character after the cursor, pressing my "delete" key in an
interactive Python window causes a system beep and inserts a tilde
character.

that's probably because the delete key can be set up to send a "\e[3~"
sequence, and readline isn't properly configured to understand that.
This behavior occurs across all of the terminals I've tried
(xterm, Konsole, real Linux terminal), but does not occur when running
bash instead of python. Other Readline-provided functionality (moving
the cursor, history) seems to work fine.

The delete key was working fine in Python up until a few days ago, and I
don't remember making any changes that should have affected it.

If anyone knows what could be causing this problem, please explain. It's
driving me crazy!

this page might help:

http://www.ibb.net/~anne/keyboard.html

or you could switch to a less lame operating system ;-) (duck).

</F>
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top