1
1
mirror of https://github.com/wez/wezterm.git synced 2024-08-16 17:50:28 +03:00

mux: ssh: add override_proxy_command to SshDomain

This enables users to override the normal invocation completely,
which is helpful for example when connecting into a gui from
a remote host.

I was wondering why prefer-mux was in here, and my commit message
from 7afc9e4d56 suggests that I
hit an issue where the gui wasn't running and where I didn't care
because I wanted to hit the mux.

I think that makes it a little awkward to blanket remove the
--prefer-mux flag, but for those that don't want it, they should now
be able to configure to allow connected to the gui

```
  ssh_domains = {
    {
      name = "shortname",
      remote_address = "hostname",
      override_proxy_command = "wezterm cli proxy",
    },
  },
```
This commit is contained in:
Wez Furlong 2024-05-08 15:32:38 -07:00
parent 6b66b6674a
commit f6fdfeb9fd
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387
2 changed files with 6 additions and 1 deletions

View File

@ -83,6 +83,9 @@ pub struct SshDomain {
/// The path to the wezterm binary on the remote host
pub remote_wezterm_path: Option<String>,
/// Override the entire `wezterm cli proxy` invocation that would otherwise
/// be computed from remote_wezterm_path and other information.
pub override_proxy_command: Option<String>,
pub ssh_backend: Option<SshBackend>,

View File

@ -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)