You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Run Python in Terminal" Command messes up file path #824
VS Code version: 1.20.1
Python Extension version: 2018.1.0
Python Version: 3.6.0
OS and version: Windows 10
Description
Let's say I have a file at C:\\Users\username\Documents\GitHub\Gists\Example\example.py. Selecting Run Python Script in Terminal from the Command Pallet sends command to terminal in the format python {path-to-current-file}.
However, the {path-to-current-file} doesn't have any \ and thus fails. So out example looks like this instead: c:UsersusernameDocumentsGitHubGistsExampleexample.py. Obviously the Python then comes back and says that it can't find the file.
Here's the weird part: it doesn't happen everywhere. From what I can tell, anything underneath C:\\Users\username\Documents will not work. A file in C:\\Users\username won't work either, but C:\\Users\username\Google Drive will perfectly fine.
Note that I'm currently using bash as my default terminal on Windows. I think this might have something to do with it maybe?
Output from Terminal:
$ python c:\Users\u2berggeist\Music\example.py
C:\Users\u2berggeist\Anaconda3\python.exe: can't open file 'c:Usersu2berggeistMusicexample.py': [Errno 2] No such file or directory
Everything works when I use PowerShell as the integrated terminal instead of bash. I think it might have something to do with the lack of spaces. ie. if the path has no spaces, it doesn't come up correctly in bash. If the file path does have spaces, it interprets it correctly.
Activity
jrwrigh commentedon Feb 19, 2018
Everything works when I use PowerShell as the integrated terminal instead of bash. I think it might have something to do with the lack of spaces. ie. if the path has no spaces, it doesn't come up correctly in bash. If the file path does have spaces, it interprets it correctly.
DonJayamanne commentedon Feb 19, 2018
Duplicate of #707
Please install the Insiders Build untill we release a new version (some time end of this month).
jrwrigh commentedon Feb 19, 2018
Gotcha. Sorry for the duplicate.
DonJayamanne commentedon Feb 19, 2018
No worries. What matters is you're issue has been resolved.