diff --git a/Cargo.lock b/Cargo.lock index cbd977bd6ed4089d281697145105fbc48ac03f2e..eaebebd2a0cc301fbc7b227ac4bcb00188c1bca7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13769,7 +13769,6 @@ dependencies = [ "serde", "serde_json", "settings", - "shlex", "smol", "tempfile", "thiserror 2.0.17", diff --git a/crates/remote/Cargo.toml b/crates/remote/Cargo.toml index 02560484922fd5b02b348a74493c0af5ca4f78d1..d1a91af9a5decc88b4c70c69001ba6dad18e4b8b 100644 --- a/crates/remote/Cargo.toml +++ b/crates/remote/Cargo.toml @@ -34,7 +34,6 @@ rpc = { workspace = true, features = ["gpui"] } serde.workspace = true serde_json.workspace = true settings.workspace = true -shlex.workspace = true smol.workspace = true tempfile.workspace = true thiserror.workspace = true diff --git a/crates/remote/src/transport/ssh.rs b/crates/remote/src/transport/ssh.rs index 2220846f76d714308cd8c9bf3f6d7bf0bb2bcdf1..2d3adba756a181fc9b54e1a8127b04a3833eb0a9 100644 --- a/crates/remote/src/transport/ssh.rs +++ b/crates/remote/src/transport/ssh.rs @@ -1077,7 +1077,10 @@ impl SshConnectionOptions { "-w", ]; - let mut tokens = shlex::split(input).context("invalid input")?.into_iter(); + let mut tokens = ShellKind::Posix + .split(input) + .context("invalid input")? + .into_iter(); 'outer: while let Some(arg) = tokens.next() { if ALLOWED_OPTS.contains(&(&arg as &str)) { diff --git a/crates/util/src/shell.rs b/crates/util/src/shell.rs index 086188fd49915d94853a64847106a0078b9486c4..a909bd574adb814061a512bd3cb4be2df6d0f504 100644 --- a/crates/util/src/shell.rs +++ b/crates/util/src/shell.rs @@ -435,6 +435,10 @@ impl ShellKind { }) } + pub fn split(&self, input: &str) -> Option> { + shlex::split(input) + } + pub const fn activate_keyword(&self) -> &'static str { match self { ShellKind::Cmd => "",