From 9d5a8ec7e8aae778c62876116961caf9e9eeb190 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sun, 17 Oct 2021 09:52:19 -0700 Subject: [PATCH] mux: fix local/remote tab tracking The issue here is that when spawning a new tab in the mux client, we didn't record the local/remote tab id mapping. Subsequently, when processing the overall list of tabs, we'd realize that the mapping was missing and allocate a new local tab to act as the holder for the existing remote tab and end up with a strange aliased view of the tab in a second tab! This commit establishes that mapping at the time that we spawn the new pane. refs: https://github.com/wez/wezterm/issues/1222 --- wezterm-client/src/domain.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wezterm-client/src/domain.rs b/wezterm-client/src/domain.rs index 60f137e35..c66d185c7 100644 --- a/wezterm-client/src/domain.rs +++ b/wezterm-client/src/domain.rs @@ -399,6 +399,8 @@ impl Domain for ClientDomain { )); let tab = Rc::new(Tab::new(&size)); tab.assign_pane(&pane); + inner.remove_old_tab_mapping(result.tab_id); + inner.record_remote_to_local_tab_mapping(result.tab_id, tab.tab_id()); let mux = Mux::get().unwrap(); mux.add_tab_and_active_pane(&tab)?;