Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Tab Completion: completer for ls? #2639

Open
rmcgibbo opened this Issue · 6 comments

4 participants

@rmcgibbo

%cd has a special tab completer (source at core/completerlib.py:cd_completer, registered with the completer system inside interactiveshell.py).

Which means that with %cd, only directories show up

In[14]: MyValue = 10

In [15]: cd M<TAB>
Mail/    Movies/  Music/  

But with %ls, we're not so fortunate. Python objects show up in addition to files and directories

In [38]: ls M<TAB>
Mail/        MemoryError  Movies/      Music/       MyValue  

This would be an easy feature to add.

@rmcgibbo

Actually... I just checked %lsmagic and it seems I was slightly confused. There is no IPython %ls magic. Instead, because my .bashrc aliases ls to ls -F, it's added to ipython's alias table (would it have been added to the alias table regardless? I'm not sure where the IPython alias table is constructed.)

Even still, should system commands that are available in IPython as automagic-y shell commands (by virtue of being in the alias table or whatever) be given shell-style tab completion?

@Carreau
Owner
@takluyver
Owner
@rmcgibbo

Yeah, definitely can do. I am happy to implement it.

I didn't know that these features existed actually (the $ completion)

If there's any way that someone could write down like a grammer... That would be really helpful. Is there anything like an IPython specific language spec? If not, no big deal.

@takluyver
Owner
@rmcgibbo
@minrk minrk removed the type-enhancement label
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.