[IPython-User] Making Control-D work when the line is not clear

Aaron Meurer asmeurer@gmail....
Tue Oct 18 21:08:29 CDT 2011

On Tue, Oct 18, 2011 at 8:03 PM, Fernando Perez <fperez.net@gmail.com> wrote:
> On Tue, Oct 18, 2011 at 6:49 PM, Aaron Meurer <asmeurer@gmail.com> wrote:
>> It definitely would be nice though if I could just make C-d raise
>> EOFError (without affecting the input text at all).  Would it be
>> possible to make it so readline commands can execute arbitrary code
>> internally?  I don't know enough about the architecture of IPython to
>> know if this would be possible or not.
> I don't think so.  This isn't really about ipython, but about what the
> python readline module allows.  And the api is limited to text
> manipulation:
> http://docs.python.org/library/readline.html
> I don't see anything to bind arbitrary Python callbacks to keystrokes.
> Cheers,
> f

Maybe I'm mistaken, but wouldn't it have to be IPython to do it, since
the callback would have to run separately in a different process (like
on the kernel or something)?

Anyway, maybe it's something to think about for the QT console, where
you have more control over these things.

Aaron Meurer

More information about the IPython-User mailing list