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:
1 parent
d54bf21826
commit
87cb593554
2 files changed
+4
-2
No files matched your search
@@ -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>;
|
||||
|
||||
@@ -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(())
|
||||
|
||||
Reference in new issue
Block a user