-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quoting args doesn't work as expected on Windows #41
Comments
The problem is that every application can parse the command line differently. The current implementation works well with applications that use So 28be849 breaks escaping for the first group of applications. I would solve the problem in microsoft/vscode#19078 by using |
The issue with Do you have an example command/args where the change would fail? |
@Tyriar When calling an executable with an array of arguments, almost every CLI-App splits this Commandline according to these rules (the only exception I currently know of, is old legacy cmd.exe). As node-pty presents an Unix-like interface to conlole applications, it should also provide a unix-like Many modern Commandshells on windows do this:
To solve the problem with cmd, one could allow passing a string as 28be849 is very inconsistent (backslashes are escaped, quotes not?). If it is really desired, to let the user quote arguments himself, Examples where 28be849 fails: Starting any other Commandlineapplication than cmd.exe with complicated arguments. |
Thanks for the detailed explanation @TSlivede, makes sense. I was holding off on release until I got someone who knows more about the area to confirm 😄 I'll probably allow args as a string as you suggest: export function fork(file?: string, args?: string | string[], opt?: IPtyForkOptions): ITerminal |
@Tyriar Very nice!! 👍 👍 👍 |
Sounds good 👍 |
Just another note: To solve the problem in microsoft/vscode#19078, one could simply replace One more Note: |
Fixed in #47 |
Downstream issue: microsoft/vscode#19078
argvToCommandLine
makes the following transformation:The text was updated successfully, but these errors were encountered: