mirror of
https://github.com/wez/wezterm.git
synced 2024-11-23 15:04:36 +03:00
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:
parent
58d969e77c
commit
e314d84711
@ -474,6 +474,11 @@ impl Domain for ClientDomain {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn attach(&self) -> anyhow::Result<()> {
|
async fn attach(&self) -> anyhow::Result<()> {
|
||||||
|
if self.state() == DomainState::Attached {
|
||||||
|
// Already attached
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
let domain_id = self.local_domain_id;
|
let domain_id = self.local_domain_id;
|
||||||
let config = self.config.clone();
|
let config = self.config.clone();
|
||||||
|
|
||||||
|
@ -267,9 +267,6 @@ async fn spawn_tab_in_default_domain_if_mux_is_empty(
|
|||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
let mux = Mux::get().unwrap();
|
let mux = Mux::get().unwrap();
|
||||||
|
|
||||||
if !mux.is_empty() {
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
let domain = mux.default_domain();
|
let domain = mux.default_domain();
|
||||||
domain.attach().await?;
|
domain.attach().await?;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user