From cae229cadc28d578e20942c7e964741ad71aba15 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 5 May 2026 12:02:12 +0000 Subject: [PATCH] Discard queued data and clear offsets when turning pane off to prevent later read of data that has been removed. From Aaron Campbell in GitHub issue 5054. --- control.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/control.c b/control.c index f7fb761c..4a7201ef 100644 --- a/control.c +++ b/control.c @@ -356,6 +356,9 @@ control_set_pane_off(struct client *c, struct window_pane *wp) struct control_pane *cp; cp = control_add_pane(c, wp); + control_discard_pane(c, cp); + memcpy(&cp->offset, &wp->offset, sizeof cp->offset); + memcpy(&cp->queued, &wp->offset, sizeof cp->queued); cp->flags |= CONTROL_PANE_OFF; }