arrow keys don't work

2007-01-22 Thread tac-tics
I've noticed that in Python 2.5, the interactive prompt does not
support intelligent use of arrow keys like 2.4 did (up/down for
previous/next statement, left/right for moving the cursor). What
exactly is the reason for this and is there an easier fix than
downgradinig to 2.4? Thanks.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: arrow keys don't work

2007-01-22 Thread Robert Kern
tac-tics wrote:
 I've noticed that in Python 2.5, the interactive prompt does not
 support intelligent use of arrow keys like 2.4 did (up/down for
 previous/next statement, left/right for moving the cursor). What
 exactly is the reason for this and is there an easier fix than
 downgradinig to 2.4? Thanks.

Your installation of 2.4 probably had the readline module installed while your
installation of 2.5 doesn't. What platform are you on?

-- 
Robert Kern

I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth.
  -- Umberto Eco

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: arrow keys don't work

2007-01-22 Thread tac-tics

Robert Kern wrote:
 tac-tics wrote:
  I've noticed that in Python 2.5, the interactive prompt does not
  support intelligent use of arrow keys like 2.4 did (up/down for
  previous/next statement, left/right for moving the cursor). What
  exactly is the reason for this and is there an easier fix than
  downgradinig to 2.4? Thanks.

 Your installation of 2.4 probably had the readline module installed while your
 installation of 2.5 doesn't. What platform are you on?

Actually, I should have posted this a while ago. I've noticed it on
Ubuntu Linux, Mac OSX, and earlier today on Sun Solaris.

What do I need to do to install / configure readline?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: arrow keys don't work

2007-01-22 Thread Steven D'Aprano
On Mon, 22 Jan 2007 14:53:01 -0800, tac-tics wrote:

 I've noticed that in Python 2.5, the interactive prompt does not
 support intelligent use of arrow keys like 2.4 did (up/down for
 previous/next statement, left/right for moving the cursor). 

It works perfectly for me.

 What
 exactly is the reason for this and is there an easier fix than
 downgradinig to 2.4? Thanks.

Have you changed your terminal (either the program itself or its config)
so that it is no longer sending the correct codes?

When you hit the arrow key, what happens? Do you just get nothing at all,
or do you get control characters appearing? e.g. ^Z or similar.


-- 
Steven D'Aprano 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: arrow keys don't work

2007-01-22 Thread tac-tics
 Have you changed your terminal (either the program itself or its config)
 so that it is no longer sending the correct codes?

I doubt this is the case. Everything works for the bash shell and
common lisp. It's just python acting up.

 When you hit the arrow key, what happens? Do you just get nothing at all,
 or do you get control characters appearing? e.g. ^Z or similar.

udlr yields ^[[A^[[B^[[C^[[D in the interactive python interpreter, but
like I said, works like it should outside the Python interpreter.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: arrow keys don't work

2007-01-22 Thread tac-tics
It looks like I got readline working. Thanks for the help!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: arrow keys don't work

2007-01-22 Thread Terry Reedy

tac-tics [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
| Have you changed your terminal (either the program itself or its config)
| udlr yields ^[[A^[[B^[[C^[[D in the interactive python interpreter, but
| like I said, works like it should outside the Python interpreter.

If I remember correctly, '^[' represents the escape character and '^[[A', 
etc  represent the standard ANSI terminal escape sequences for the up, etc, 
key.  So you are missing the interpretive layer that should intercept and 
act on those sequences and Python is getting them raw (literally).

tjr



-- 
http://mail.python.org/mailman/listinfo/python-list