1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-23 21:32:13 +03:00

mux: client would prune out the empty window when connecting via ssh/tls domain

When the client connected to an empty remote mux, it would allocate an
empty window and then spawn a new tab into it.

Meanwhile, the authentication window would close and trigger a prune of
all empty windows, causing the in-flight spawn to fail because its
destination window was removed.

This commit defers window pruning while Activity is in progress;
the MuxWindowBuilder has an associated Activity count.
This commit is contained in:
Wez Furlong 2021-05-30 23:50:13 -07:00
parent d54bf21826
commit 87cb593554
2 changed files with 4 additions and 2 deletions

View File

@ -426,6 +426,9 @@ impl Mux {
}
pub fn prune_dead_windows(&self) {
if Activity::count() > 0 {
return;
}
let live_tab_ids: Vec<TabId> = self.tabs.borrow().keys().cloned().collect();
let mut dead_windows = vec![];
let dead_tab_ids: Vec<TabId>;

View File

@ -269,8 +269,7 @@ async fn spawn_tab_in_default_domain_if_mux_is_empty(
let config = config::configuration();
let window_id = mux.new_empty_window();
let _tab = mux
.default_domain()
let _tab = domain
.spawn(config.initial_size(), cmd, None, *window_id)
.await?;
Ok(())