diff --git a/docs/changelog.md b/docs/changelog.md index b441a7b71..3b4266872 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -27,6 +27,7 @@ As features stabilize some brief notes about them will accumulate here. * tab titles truncated too short [#2379](https://github.com/wez/wezterm/issues/2379) * `bypass_mouse_reporting_modifiers` stopped working (regression around new mouse binding logic) [#2389](https://github.com/wez/wezterm/issues/2389) * Entering IME-composed text would have no effect in `wezterm ssh` [#2434](https://github.com/wez/wezterm/issues/2434) +* `gui-startup` event now also works with `wezterm ssh` ### 20220807-113146-c2fee766 diff --git a/wezterm-gui/src/main.rs b/wezterm-gui/src/main.rs index a9d4af34a..d2d38b0b3 100644 --- a/wezterm-gui/src/main.rs +++ b/wezterm-gui/src/main.rs @@ -130,6 +130,16 @@ async fn async_run_ssh(opts: SshCommand) -> anyhow::Result<()> { ..Default::default() }; + let start_command = StartCommand { + always_new_process: true, + class: opts.class, + cwd: None, + no_auto_connect: true, + position: opts.position, + workspace: None, + prog: opts.prog.clone(), + }; + let cmd = if !opts.prog.is_empty() { let builder = CommandBuilder::from_argv(opts.prog); Some(builder) @@ -138,8 +148,12 @@ async fn async_run_ssh(opts: SshCommand) -> anyhow::Result<()> { }; let domain: Arc = Arc::new(mux::ssh::RemoteSshDomain::with_ssh_domain(&dom)?); + let mux = Mux::get().unwrap(); + mux.add_domain(&domain); + mux.set_default_domain(&domain); - async_run_with_domain_as_default(domain, cmd).await + let should_publish = false; + async_run_terminal_gui(cmd, start_command, should_publish).await } fn run_ssh(opts: SshCommand) -> anyhow::Result<()> {