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

run command autocompletion uses backslashes in Windows #95

Closed
ipython opened this issue May 10, 2010 · 2 comments
Closed

run command autocompletion uses backslashes in Windows #95

ipython opened this issue May 10, 2010 · 2 comments
Milestone

Comments

@ipython
Copy link
Collaborator

ipython commented May 10, 2010

Original Launchpad bug 275361: https://bugs.launchpad.net/ipython/+bug/275361
Reported by: kari-pulli (Kari Pulli).

On WIndows XP IPython 0.9.rc1, autocompletion correctly often uses forward slash (/), for example with ls.
However, when I use the magic word run, with a script name, and the script needs command line arguments, the autocompletion uses backslashes.
Example: I type "run register.py images/1.jpg" and hit TAB, the line changes to "run register.py images\1.jpg", and by the time my script gets the argument, the backslash is gone, the filename becomes "images1.jpg"

Also, when I %run a script, it would be nice if the wild characters were evaluated before passing the parameters to python.
Example: "run register.py images/?.jpg" should expand to "register.py images/1.jpg images/2.jpg images/3.jpg". That's what it does on command line...

@ipython
Copy link
Collaborator Author

ipython commented May 10, 2010

[ LP comment 1 by: Hari, on 2009-07-01 20:46:44.470610+00:00 ]

The problem is not specific to completing arguments, it also exists for running scripts that are not in current directory. I am almost always in the dev root when I run iPython and so have to run scripts that are in subdirectories. When I use autocompletion, it introduces backslashes and so have to (painfully) remember to change them to forwardslashes before pressing enter. Since all the newer versions of windows almost always accept forwardslashes as good as backwardslashes, why not just stick to forwardslashes? For aruguments to external commands (e.g., dir), it would be a problem, but since I run all cygwin commands, I need ONLY forwardslashes.

Why not provide an option like vim's 'shellslash' and let the user choose?

@jstenar
Copy link
Member

jstenar commented Feb 27, 2014

Current IPython uses forward slashes when tabcompleting %run commands. Expansion is also the default now, can be disabled with the -G flag.

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

No branches or pull requests

2 participants