Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tab completion stops working #6271

Closed
jseabold opened this issue Aug 4, 2014 · 5 comments
Closed

tab completion stops working #6271

jseabold opened this issue Aug 4, 2014 · 5 comments
Milestone

Comments

@jseabold
Copy link
Contributor

jseabold commented Aug 4, 2014

This has gotten to be enough of a headache that I'd like to get to the bottom of it, using the regular IPython interpreter

|21 $ ipython --version
2.1.0

Tab-completion randomly stops working for me. The other symptom is that the up arrow just scrolls through the history instead of filtering on what's already typed at the prompt.

Unfortunately, I can't reproduce it deterministically. Often it happens after I %paste some code in, but that's not the only time. I've noticed this (maybe) after I changed my .inputrc, so perhaps I'm hitting some odd key combination without realizing it? .inputrc in-lined below.

Is there something I can instrument or somewhere I can insert a debug statement to help figure this out?

set editing-mode vi
set keymap vi-command

set bell-style none
$if mode=vi
    set keymap vi-command
    "gg": beginning-of-history
    "G": end-of-history
    set keymap vi-insert
    "ii": vi-movement-mode
    "\C-w": backward-kill-word
    "\C-p": history-search-backward
    "\C-e": end-of-line
    "\C-a": beginning-of-line
$endif
@takluyver
Copy link
Member

I think this must be something in readline itself, if up and down arrows stop behaving as expected. There's no callback we get for going through history with the up and down arrows, that's all handled by readline using history we've previously given it.

@jseabold
Copy link
Contributor Author

Well, I figured out one way I can replicate this behavior. Type any character then 'e' and hit up.

E.g., if I wanted to autocomplete an np.random.seed call and got to e but wanted to re-use one

np.random.se<Up>

Then tab completion stops. Same if I do.

xe<Up>

It doesn't seem to happen if e is the first character.

@jseabold
Copy link
Contributor Author

r too. I guess this is something with readline and my config.

@jseabold
Copy link
Contributor Author

As another data point, it doesn't happen when I comment out vi-insert in my inputrc, but I don't see/know of any keybinding that would cause the current behavior. Pretty frustrating.

@minrk minrk added this to the no action milestone Aug 14, 2014
@jseabold
Copy link
Contributor Author

jseabold commented Jan 5, 2015

For anyone who comes across this, by some miracle I finally found a "fix" to move from emacs mode back to vi-mode in IPython. I don't yet understand how I get dropped in to emacs mode in the first place and this only happens in ipython, but a "M-C-j" drops me back in to vi-mode (on OSX). Link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants