terminal: Fix escaping arguments when using CMD as the shell (#39701)
A couple of caveats: - We should not auto-escape arguments with Alacritty's `escape_args` option if using CMD otherwise, the generated command will have way too many escaped characters for CMD to parse correctly. - When composing a full command for CMD, we need to put it in double quotes manually: `cmd /C "activate.bat& pwsh.exe -C do_something"` so that CMD executes the entire string as a sequence of commands. - CMD requires `&` as a chaining operator for commands (`;` for other shells). Release Notes: - N/A
This commit is contained in:
@@ -49,7 +49,7 @@ impl ShellBuilder {
|
||||
format!("{} -C '{}'", self.program, command_to_use_in_label)
|
||||
}
|
||||
ShellKind::Cmd => {
|
||||
format!("{} /C '{}'", self.program, command_to_use_in_label)
|
||||
format!("{} /C \"{}\"", self.program, command_to_use_in_label)
|
||||
}
|
||||
ShellKind::Posix
|
||||
| ShellKind::Nushell
|
||||
|
||||
Reference in New Issue
Block a user