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

MinRK benjaminrk@gmail....
Tue Oct 18 19:26:54 CDT 2011


On Tue, Oct 18, 2011 at 17:17, Aaron Meurer <asmeurer@gmail.com> wrote:

> On Tue, Oct 18, 2011 at 6:01 PM, Aaron Meurer <asmeurer@gmail.com> wrote:
> > On Tue, Oct 18, 2011 at 5:48 PM, Fernando Perez <fperez.net@gmail.com>
> wrote:
> >> Hi Aaron,
> >>
> >> On Tue, Oct 18, 2011 at 4:14 PM, Aaron Meurer <asmeurer@gmail.com>
> wrote:
> >>>
> >>> Is there a way to make Control-D exit IPython even when the line is
> >>> not clear? This works for other control sequences, like Control-L, but
> >>> for Control-D, I have to first type Control-U, Control-K to clear the
> >>> line.  I am on Mac OS X Lion and my config file is
> >>>
> https://github.com/asmeurer/dotfiles/blob/master/.ipython/profile_default/ipython_config.py
> >>> if that matters.
> >>
> >> I don't think so, b/c C-D is ambiguous: if there's text to the right
> >> it means delete character.  My guess is that readline disables its EOF
> >> behavior as a safety precaution if it detects the line already has
> >> text on it.
> >
> > Ah, I never knew about delete character.  So I guess I really only
> > want it to do it when it's at the end of the line.  I'll see if I can
> > do it with readline.
> >
> > Aaron Meurer
>
> All I found was the binding vi-eof-maybe, which I couldn't find any
> documentation on, but if I set control-D to do it, it acts like enter
> if text is on the line and like control D otherwise.  It's hard to
> tell if this is what it's supposed to do or if IPython is just not
> recognizing the EOF with other text.
>

If you are just configuring readline, a way to check is if bash is behaving
the same as IPython.  I think they should both load the same readline config
from .inputrc.


>
> Aaron Meurer
>
> >
> >>
> >> But that feature is really in readline, you might want to poke around
> >> the readline docs to see if it's configurable: we simply trap the EOF
> >> exception and exit on it, we don't directly handle the key action.
> >>
> >> Cheers,
> >>
> >> f
> >>
> >
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20111018/ceec3eff/attachment.html 


More information about the IPython-User mailing list