Eugleo / magic-racket

The best coding experience for Racket in VS Code
https://marketplace.visualstudio.com/items?itemName=evzen-wybitul.magic-racket
GNU General Public License v3.0
202 stars 28 forks source link

Don't use 'shell-quote' on Windows #65

Closed shocoman closed 2 years ago

shocoman commented 2 years ago

Fixes #63

shell-quote is completely incompatible with Windows 1) Paths may contain colons, but shell-quote escapes them (C:/example.rkt => C\:/example.rkt) 2) If executable path is quoted in Powershell, it should be prepended by & to run. i.e. to launch Racket from the full path in Powershell one should type something like & 'C:\Program Files\Racket\Racket.exe' example.rkt

I have tested this in Command Prompt (cmd.exe), Powershell (powershell.exe) and Git Bash

Eugleo commented 2 years ago

Hey, lmk if this is ready for merging. I'll have to take your word for this, because I don't have any way to test it myself (as you might have noticed due to #63 existing in the first place).

shocoman commented 2 years ago

Okay. I have squashed commits, tested it again, and it works. I believe it is ready for merging. Here is a demo when both racket path and file path contain spaces and when they don't (on Windows 10)

https://user-images.githubusercontent.com/8329446/149271842-c6862218-e518-4b00-ab2e-ba9ad2a4bf9f.mp4

sitiom commented 2 years ago

Tested this in PowerShell Core (pwsh.exe) and it works.

sitiom commented 2 years ago

@Eugleo doesn't work in 0.6.2 from the extensions marketplace (building it myself from the latest commit works).

shocoman commented 2 years ago

Yes, it seems these changes were not properly packaged or transpiled to JS as they aren't used by default in the new version. Changing this path parameter to "./out/main.js" solves the problem