command history behavior in windows and linux

L

Leo

Does someone know if there is a setting in the python Unix world to
make the command history behave as it does in the Windows intepreter?
Specifically, I like the fact that the command history remembers which
of a sequence of commands is the one that I last issued. For example,
suppose that I typed the following lines into the interpreter:

import foo
for e in foo.container:
print e

In Unix, I would have to tap up arrow 3 times for each line:

up up up gives me "import foo". I press enter.
up up up gives me "for...". I press enter.
up up up gives me " print...". I press enter.

In Windows, I get this behavior I like better:

up up up gives me "import foo". I press enter.
down gives me "for...". I press enter.
down gives me " print...". I press enter.

How do I get the second behavior to take place in all the platforms I
use? Also, the windows version remembers my commands across sections.
How do I enable that in the python version?

I tried editing the inputrc file that controls the readline library by
adding the following lines:

$if python
set history-preserve-point on
$endif

but this did not seem to work.

TIA,
Leo.
 

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

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top