Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
remote: Add support for additional SSH arguments in SshSocket (#33243)
Umesh Yadavc39f294bcbae
diff --git a/crates/remote/src/ssh_session.rs b/crates/remote/src/ssh_session.rsindex df7212d44c4..2f462a86a5a 100644--- a/crates/remote/src/ssh_session.rs+++ b/crates/remote/src/ssh_session.rs@@ -400,6 +400,7 @@ impl SshSocket {.stdin(Stdio::piped()).stdout(Stdio::piped()).stderr(Stdio::piped())+ .args(self.connection_options.additional_args()).args(["-o", "ControlMaster=no", "-o"]).arg(format!("ControlPath={}", self.socket_path.display()))}@@ -410,6 +411,7 @@ impl SshSocket {.stdin(Stdio::piped()).stdout(Stdio::piped()).stderr(Stdio::piped())+ .args(self.connection_options.additional_args()).envs(self.envs.clone())}@@ -417,22 +419,26 @@ impl SshSocket {// On Linux, we use the `ControlPath` option to create a socket file that ssh can use to#[cfg(not(target_os = "windows"))]fn ssh_args(&self) -> SshArgs {+ let mut arguments = self.connection_options.additional_args();+ arguments.extend(vec![+ "-o".to_string(),+ "ControlMaster=no".to_string(),+ "-o".to_string(),+ format!("ControlPath={}", self.socket_path.display()),+ self.connection_options.ssh_url(),+ ]);SshArgs {- arguments: vec![- "-o".to_string(),- "ControlMaster=no".to_string(),- "-o".to_string(),- format!("ControlPath={}", self.socket_path.display()),- self.connection_options.ssh_url(),- ],+ arguments,envs: None,}}#[cfg(target_os = "windows")]fn ssh_args(&self) -> SshArgs {+ let mut arguments = self.connection_options.additional_args();+ arguments.push(self.connection_options.ssh_url());SshArgs {- arguments: vec![self.connection_options.ssh_url()],+ arguments,envs: Some(self.envs.clone()),}}