diff --git a/config/src/ssh.rs b/config/src/ssh.rs index 1680eab46..e725800fd 100644 --- a/config/src/ssh.rs +++ b/config/src/ssh.rs @@ -83,6 +83,9 @@ pub struct SshDomain { /// The path to the wezterm binary on the remote host pub remote_wezterm_path: Option, + /// Override the entire `wezterm cli proxy` invocation that would otherwise + /// be computed from remote_wezterm_path and other information. + pub override_proxy_command: Option, pub ssh_backend: Option, diff --git a/wezterm-client/src/client.rs b/wezterm-client/src/client.rs index 8e0a4816d..eddbabb81 100644 --- a/wezterm-client/src/client.rs +++ b/wezterm-client/src/client.rs @@ -664,7 +664,9 @@ impl Reconnectable { let sess = ssh_connect_with_ui(ssh_config, ui)?; let proxy_bin = Self::wezterm_bin_path(&ssh_dom.remote_wezterm_path); - let cmd = if initial { + let cmd = if let Some(cmd) = ssh_dom.override_proxy_command.clone() { + cmd + } else if initial { format!("{} cli --prefer-mux proxy", proxy_bin) } else { format!("{} cli --prefer-mux --no-auto-start proxy", proxy_bin)