Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ipython filepath autocompletion: string closing quotation insertion

If I start to type in a filepath by itself, and tab complete it, it works great, i.e.

In [1]: ~
[TAB]
In [1]: /Users/zhermes/

But if it's inside a quotation, it also auto-closes the quotation, i.e.

In [2]: "~
[TAB]
In [2]: "/Users/zhermes/"

which makes it annoying to continue inserting more path... Is there anyway to disable this behavior?


Edits:
Note: this is ipython issue #1172.
Workaround: Close the quotes before starting to enter the path, then tab-completion won't need to close it. i.e.

In [1]: ""
In [1]: "~[TAB]"
In [1]: "/Users/DilithiumMatrix/"
like image 853
DilithiumMatrix Avatar asked Nov 01 '13 15:11

DilithiumMatrix


1 Answers

IPython 5 (which now uses prompt_toolkit and has many changes to how completions work) appears to fix this. If I type "~<TAB> it completes my home directory without inserting a closing quote.

like image 67
asmeurer Avatar answered Oct 09 '22 20:10

asmeurer