Fix output folding across resize and refresh

Keep backing row mappings and selection endpoints correct after
wrapping. Preserve exit status during reflow and collapsed state
during refresh. Clip the gutter to fit narrow panes.

Add regression coverage for these cases.
This commit is contained in:
Michael Grant
2026-10-13 11:09:49 +02:00
parent b1e4306ace
commit 86f857d1f3
4 changed files with 343 additions and 30 deletions

4
grid.c
View File

@@ -1389,6 +1389,10 @@ grid_reflow_move_osc133(struct grid_line *to, struct grid_line *from,
from->flags &= ~flag;
*src_col[i] = 0;
if (flag == GRID_LINE_END_OUTPUT) {
/* Keep status presence with the D marker. */
to->flags &= ~GRID_LINE_END_OUTPUT_STATUS;
to->flags |= from->flags & GRID_LINE_END_OUTPUT_STATUS;
from->flags &= ~GRID_LINE_END_OUTPUT_STATUS;
dst->exit_status = src->exit_status;
src->exit_status = 0;
}