wezterm connect unix could exit on startup

This is a similar race condition to one we had before with the
multiplexer, where the connection UI made us think that we didn't
need to start a new process.

Additionally, the attach method would unconditionally create a
new client without checking whether we already had one.
This commit is contained in:
Wez Furlong committed 2022-01-11 22:35:31 -07:00
1 parent 58d969e77c
commit e314d84711
2 files changed
+5 -3

No files matched your search

+5
View File
@@ -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();
-3
View File
@@ -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?;