From 9f7daca00cbd42dc5b98486c0253197a34e707ef Mon Sep 17 00:00:00 2001 From: Michael Grant Date: Tue, 6 Oct 2026 13:44:25 +0200 Subject: [PATCH] When the line containing the OSC 133 'A' marker has been discarded from history, scan retained output markers up to the next prompt. Copying and selection work from inside or after the output. --- window-copy.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/window-copy.c b/window-copy.c index bf9e0611d..6b100340e 100644 --- a/window-copy.c +++ b/window-copy.c @@ -6339,11 +6339,14 @@ window_copy_find_output_range(struct window_mode_entry *wme, u_int *sx, } if (prompt_y == UINT_MAX) { log_debug("%s: no osc133 prompt before cursor", __func__); - return (0); + y = 0; + } else { + log_debug("%s: prompt at %u,%u", __func__, prompt_x, + prompt_y); + y = prompt_y; } - log_debug("%s: prompt at %u,%u", __func__, prompt_x, prompt_y); - for (y = prompt_y; y < total; y++) { + for (; y < total; y++) { gl = grid_get_line(gd, y); od = &gl->osc133_data; next_prompt = (y != prompt_y &&