DavesCodeMusings / mpremote-vscode

Visual Studio Code extension for mpremote Python module
BSD 2-Clause "Simplified" License
10 stars 1 forks source link

Run command cannot handle path/filename with space(s) #2

Closed erikdelange closed 1 year ago

erikdelange commented 1 year ago

Situation: Filename in the active editor is c:\Directory with a space\hello.py

Executing command MPRemote: Run File Shown in the Active Editor (run) will fail with the following output:

(MicroPython) PS C:\Directory with a space> py.exe -m mpremote connect COM6 run c:\Directory with a space\hello.py mpremote: could not read file 'c:\Directory'

Problem is that the filename is truncated at the first space. When manually adding quotes around the file argument and rerunning the command it does work.

(MicroPython) PS C:\Directory with a space> py.exe -m mpremote connect COM6 run "c:\Directory with a space\hello.py" Hello there

Using:

DavesCodeMusings commented 1 year ago

I'll take a look at adding quotes. Thanks for posting the issue with a proposed solution.

DavesCodeMusings commented 1 year ago

Added single quotes around paths used with the run and copy commands to allow for spaces. Tested okay on my Windows installation. Pushed changes to GitHub and published to VSCode Marketplace.

@erikdelange Please test when you have time and let me know if it works for you.

erikdelange commented 1 year ago

Tested and it works perfectly. Thank you for fixing this so quickly.