Skip to content

TAB completion for pdb/ipdb in qtconsole is not working #902

edVonSchleck opened this Issue Oct 19, 2011 · 6 comments

6 participants


this issue is qtconsole specific. ipdb is working fine in a "normal" ipython session.
i'm using ipython 0.11 (stable release) on opensuse 11.4

IPython member
fperez commented Oct 19, 2011

Yup, currently ipdb in the qtconsole has two major and related limitations: no history (see #682) and no tab completion. We'd love some manpower on this...

CRP commented Apr 19, 2012

I tried playing around a bit with rlcompleter within pdb, alas without success. Any suggestion on how this problem should be approached? I understand that pdb basically uses raw_input to get commands, so one should probably replace that with a more advanced shell?

IPython member

It's not something that can be solved purely within pdb. The IPython kernel would need a way to delegate finding tab completions at a raw_input prompt to the package that produced the prompt. AFAIK, the kernel also blocks while waiting for input, so we'd need some way to work around that. That will probably take quite some thought.

IPython member
fperez commented Apr 19, 2012

Agreed, this is not an easy one: in the terminal, I'm pretty sure readline runs in a thread and calls the completion code in that thread, but it does all that automatically, so user code only has to provide custom completers, without worrying about thread management. I'm really not sure how to get the completion code to fire on a kernel that's blocking while it waits for stdin: we can certainly capture the event on the client easily, but the question is how to send the completion request to the kernel whose main thread is blocking (the zmq code listens on the main thread). Tricky one indeed.

CRP commented Apr 19, 2012

If pdb uses raw_input, which is a function in ipython/zmq, would it be possible to create a second, thread-aware version of raw_input, and then get pdb to use that?

dashesy commented Apr 7, 2013

Sorry if I sound like a fool, I certainly do not know about the iPython code.
Is it possible to pipe stdin/stdout of the pdb and never actually give it access to the console, instead the same thread as iPython will get the console, interpret it (maybe Tab complete), then write to pdb stdin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.