-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
There are multiple significant issues with spawnWithShell on Windows:
-
It finds the executable by looking at the string and naively scanning for quotes. This doesn't respect
^-escaped spaces. -
This quote-scanning doesn't match types of quotes. For instance,
"'my double quoted path'"will open quotes at the first"character and then say the quotes have ended at the'character. -
Finally, the path is passed to
which.syncwith the quotes intact. So it's looking for an executable with those quotes in its path. -
The
isCmdregex searches for\but/is a legal alternative path separator on windows. -
Shell can be passed in. It's not unlikely that, if the user is on Windows, they're using PowerShell. In that case, I don't know what's supposed to happen.
Originally reported at npm/cli#6716 (comment)