Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Support SSH usernames which contain @ symbols (#25314)
Color Fuzzya0f995d2aec9
diff --git a/Cargo.lock b/Cargo.lockindex 56f17318aa3..5ea631d7c4f 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -11253,6 +11253,7 @@ dependencies = ["smol","tempfile","thiserror 1.0.69",+ "urlencoding","util",]diff --git a/Cargo.toml b/Cargo.tomlindex 4f853a62048..d0145940c09 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -565,6 +565,7 @@ unindent = "0.2.0"unicode-segmentation = "1.10"unicode-script = "0.5.7"url = "2.2"+urlencoding = "2.1.2"uuid = { version = "1.1.2", features = ["v4", "v5", "v7", "serde"] }wasmparser = "0.221"wasm-encoder = "0.221"diff --git a/crates/feedback/Cargo.toml b/crates/feedback/Cargo.tomlindex 75264a970ac..05577afc044 100644--- a/crates/feedback/Cargo.toml+++ b/crates/feedback/Cargo.toml@@ -36,7 +36,7 @@ serde_json.workspace = truesmol.workspace = truesysinfo.workspace = trueui.workspace = true-urlencoding = "2.1.2"+urlencoding.workspace = trueutil.workspace = trueworkspace.workspace = truezed_actions.workspace = truediff --git a/crates/remote/Cargo.toml b/crates/remote/Cargo.tomlindex 4bb33d6db44..43edb8cdc8a 100644--- a/crates/remote/Cargo.toml+++ b/crates/remote/Cargo.toml@@ -39,6 +39,7 @@ shlex.workspace = truesmol.workspace = truetempfile.workspace = truethiserror.workspace = true+urlencoding.workspace = trueutil.workspace = true[dev-dependencies]diff --git a/crates/remote/src/ssh_session.rs b/crates/remote/src/ssh_session.rsindex 0309fb5da94..d254526e188 100644--- a/crates/remote/src/ssh_session.rs+++ b/crates/remote/src/ssh_session.rs@@ -203,7 +203,8 @@ impl SshConnectionOptions {anyhow::bail!("unsupported argument: {:?}", arg);}let mut input = &arg as &str;- if let Some((u, rest)) = input.split_once('@') {+ // Destination might be: username1@username2@ip2@ip1+ if let Some((u, rest)) = input.rsplit_once('@') {input = rest;username = Some(u.to_string());}@@ -238,7 +239,9 @@ impl SshConnectionOptions {pub fn ssh_url(&self) -> String {let mut result = String::from("ssh://");if let Some(username) = &self.username {- result.push_str(username);+ // Username might be: username1@username2@ip2+ let username = urlencoding::encode(username);+ result.push_str(&username);result.push('@');}result.push_str(&self.host);diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.tomlindex af7eec4df7c..c5e53b817bb 100644--- a/crates/zed/Cargo.toml+++ b/crates/zed/Cargo.toml@@ -124,7 +124,7 @@ time.workspace = truetoolchain_selector.workspace = trueui.workspace = trueurl.workspace = true-urlencoding = "2.1.2"+urlencoding.workspace = trueutil.workspace = trueuuid.workspace = truevim.workspace = true