From e14d49749f5861eea8cc1605019361439f531ab8 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 19dd0e61f..f40557c6a 100644 --- a/window-copy.c +++ b/window-copy.c @@ -6252,11 +6252,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 &&