[IPython-User] Getting a clean prompt without Ctrl-C
Fri Jan 13 22:47:22 CST 2012
Fernando Perez <email@example.com> writes:
> On Fri, Jan 13, 2012 at 4:51 PM, Nikolaus Rath <Nikolaus@rath.org> wrote:
>> Is there a way to get a clean prompt using a different key combination
>> than Ctrl-C? Note that I don't want to interrupt any computations, I'm
>> talking about the case where I have lots of input in the prompt and want
>> to discard it all at once.
> Well, there's always C-a, C-k: go to beginning of line, kill line.
> That's actually what I use...
> It may be possible to hook up something with the python readline
> module and a readline configuration file (~/.inputrc), but you'd have
> to check the readline docs for that, it's not something IPython
Oh, ipython is using readline? I assumed it was using something else,
because of the history behavior. In all readline programs I known
pressing up-arrow brings you to the previous input, but in ipython it
brings you to the most-recent input starting with the substring of the
current input up to the cursor position. If that's a readline feature,
I'll have to try to make bash use it as well. It takes a while to get
used to, but then it's really convenient.
»Time flies like an arrow, fruit flies like a Banana.«
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
More information about the IPython-User