ionide-vscode-fsharp icon indicating copy to clipboard operation
ionide-vscode-fsharp copied to clipboard

Run Script Does Not Work For Scripts With UNC File Paths

Open LukeBurgessYeo opened this issue 5 years ago • 2 comments

Description On Windows with a script (.fsx) file in a UNC directory, the "Run Script" button does not work because Ionide uses cmd.exe and the cd command which does not work with UNC file paths.

To Reproduce Steps to reproduce the behaviour:

  1. Create a script file in a UNC directory with whatever code you like.
  2. Click on the "Run Script" button.
  3. Observe the new terminal instance with the message "CMD does not support UNC paths as current directories.".

Expected behaviour The script should run.

Environment:

  • OS: Microsoft Windows 10 Pro
  • Ionide version: 4.5.0
  • VSCode version: 1.42.0

Workaround Use a mapped directory instead...

Additional notes Having seen this error, if you then kill the terminal (using the "bin" icon) the VS Code window crashes.

Potential fix Looks like this can be fixed by changing the cd command to pushd on this line. Also the extra quotes on this line around the %s which corresponds to flatArgs are not needed.

LukeBurgessYeo avatar Feb 10 '20 11:02 LukeBurgessYeo

Hey @LukeBurgessYeo :wave:,

Thank you for opening an issue. We will get back to you as soon as we can. Also, check out our OpenCollective and consider backing us.

https://opencollective.com/ionide

PS.: We offer backer support for all backers. Don't forget to add backer label when you start backing us :smile:

Firstly, I quite like the "Run Script" button because it means I can write scripts that behave a bit more like applications without having to create an fsharp project, etc. (for example, I have some scripts that do monitoring and it's kinda nice to just be able to hit "Run Script" and only see the printed outputs) So I think it's a feature worth keeping.

Secondly, if changing cd to pushd is a sensible thing to do I am happy to test it and submit a pull request. Running the same command with pushd instead of cd manually from cmd seemed to work but I haven't tried doing it from Ionide itself yet.

Also, "FSI: Send File" works fine with files in UNC directories.

LukeBurgessYeo avatar Feb 10 '20 11:02 LukeBurgessYeo