Use ShellKind::try_quote whenever we need to quote shell args (#40912)
Using `shlex` unconditionally is dangerous as it assumes the underlying shell is POSIX which is not the case for PowerShell, CMD, or Nushell. Therefore, whenever we want to quote the args we should utilise our helper `util::shell::ShellKind::try_quote` which takes into account which shell is being used to actually exec/spawn the invocation. Release Notes: - N/A --------- Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
This commit is contained in:
co-authored by
Lukas Wirth
parent
18daa9a839
commit
8f4646d6c3
@@ -774,7 +774,7 @@ impl HeadlessProject {
|
||||
envelope: TypedEnvelope<proto::GetDirectoryEnvironment>,
|
||||
mut cx: AsyncApp,
|
||||
) -> Result<proto::DirectoryEnvironment> {
|
||||
let shell = task::Shell::from_proto(envelope.payload.shell.context("missing shell")?)?;
|
||||
let shell = task::shell_from_proto(envelope.payload.shell.context("missing shell")?)?;
|
||||
let directory = PathBuf::from(envelope.payload.directory);
|
||||
let environment = this
|
||||
.update(&mut cx, |this, cx| {
|
||||
|
||||
Reference in New Issue
Block a user