Closed vagreargnatry closed 1 year ago
Thanks for working on this! Do you happen to know of any reference that explains the PowerShell quoting rules and gives more info on when they were changed...? I'd like to understand what they've changed in a bit more detail first.
I tried some basic searching, but I didn't see an obvious article to read, so that's why I'm wondering if you might have one... Thanks! 🙂
I found an answer, hope this can help you. https://stackoverflow.com/a/69844230
The test results on my computer (Windows 11 22H2) are:
PowerShell 7.3.5
, the following two commands can work:
racket --repl --eval '(enter! (file "c:/Users/omenl/Desktop/chez-playground/sample2.rkt"))'
racket --repl --eval "(enter! (file `"c:/Users/omenl/Desktop/chez-playground/sample2.rkt`"))"
Powershell 5.1.22621.1778
, only this command can work:
racket --repl --eval '(enter! (file \"c:/Users/omenl/Desktop/chez-playground/sample2.rkt\"))'
Thanks for the additional info! The answer you linked suggests that the PowerShell 5 command is called powershell
, while the PowerShell 7 command is called pwsh
. Does that match the state on your system?
If it does, perhaps the quoting rules could differ based on the command name? I might be missing something though, as I don't use PowerShell myself.
Yes, this match the state on my machine. Using command names to differentiate versions is better than using child_process
.
I'm planning to publish a release with this fix in a few days or so, once the related issue https://github.com/Eugleo/magic-racket/issues/114 is also resolved.
0.6.6 has now been published with this change. Thanks again! 😄
Different versions of PowerShell require different commands.
https://github.com/Eugleo/magic-racket/pull/95 https://github.com/Eugleo/magic-racket/issues/94
I apologize for the diff caused by the code formatting.