From b398eaf656b01be393ff0ac112247bb1dceb928a Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 28 Mar 2022 22:12:04 -0700 Subject: [PATCH] mux: fix CloseCurrentPane={confirm=false} After killing the remote pane, we no longer trigger the renderable poll stuff that would detect that the pane was dead. Let's speculatively set it to dead so that we don't get stuck with stray tabs/panes. https://github.com/wez/wezterm/issues/1752 --- docs/changelog.md | 1 + wezterm-client/src/pane/clientpane.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index d615ea897..3aa852eee 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -35,6 +35,7 @@ As features stabilize some brief notes about them will accumulate here. * Hyperlink rules with more captures than replacements could panic wezterm when text matched. [#1780](https://github.com/wez/wezterm/issues/1780) * Malformed XTGETTCAP response. [#1781](https://github.com/wez/wezterm/issues/1781) * Multiplexer performance with images was unusuable for all but tiny images. [#1237](https://github.com/wez/wezterm/issues/1237) +* `CloseCurrentPane{confirm=false}` would leave behind a phantom tab/pane when used with the multiplexer. [#1277](https://github.com/wez/wezterm/issues/1277) ### 20220319-142410-0fcdea07 diff --git a/wezterm-client/src/pane/clientpane.rs b/wezterm-client/src/pane/clientpane.rs index 9199c32b0..50663c6d6 100644 --- a/wezterm-client/src/pane/clientpane.rs +++ b/wezterm-client/src/pane/clientpane.rs @@ -381,6 +381,12 @@ impl Pane for ClientPane { .await }) .detach(); + // Explicitly mark ourselves as dead. + // Ideally we'd discover this later when polling the + // status, but killing the pane prevents the server + // side from sending us further data. + // + self.renderable.borrow().inner.borrow_mut().dead = true; } fn mouse_event(&self, event: MouseEvent) -> anyhow::Result<()> {