diff --git a/wezterm-client/src/domain.rs b/wezterm-client/src/domain.rs index 47b96c781..4afc5ffcb 100644 --- a/wezterm-client/src/domain.rs +++ b/wezterm-client/src/domain.rs @@ -474,6 +474,11 @@ impl Domain for ClientDomain { } async fn attach(&self) -> anyhow::Result<()> { + if self.state() == DomainState::Attached { + // Already attached + return Ok(()); + } + let domain_id = self.local_domain_id; let config = self.config.clone(); diff --git a/wezterm-gui/src/main.rs b/wezterm-gui/src/main.rs index 98b31c960..a2a4ad7f7 100644 --- a/wezterm-gui/src/main.rs +++ b/wezterm-gui/src/main.rs @@ -267,9 +267,6 @@ async fn spawn_tab_in_default_domain_if_mux_is_empty( ) -> anyhow::Result<()> { let mux = Mux::get().unwrap(); - if !mux.is_empty() { - return Ok(()); - } let domain = mux.default_domain(); domain.attach().await?;