Fix cursor and redraw overlap with auto-hide scrollbars

Auto-hide scrollbars are drawn as overlays inside the pane rather than in
reserved columns. Avoid optimized pane scrolling/redraw paths writing through
a visible overlay scrollbar, and suppress the terminal cursor when it would be
placed in the visible overlay scrollbar column.

This prevents transient wrong-colour cells and cursor blocks appearing over
the scrollbar, especially when scrolling small floating panes.  This fixed
the green block issue.
This commit is contained in:
Michael Grant
2026-06-20 09:09:27 +02:00
parent 738083c4a4
commit fe1c3db1e5
5 changed files with 61 additions and 11 deletions

View File

@@ -2174,6 +2174,10 @@ screen_write_collect_flush_scrolled(struct screen_write_ctx *ctx)
screen_write_redraw_pane(ctx, &ttyctx);
return 0;
}
if (wp != NULL && window_pane_scrollbar_overlay_visible(wp)) {
wp->flags |= PANE_REDRAW;
return 0;
}
log_debug("%s: scrolled %u (region %u-%u)", __func__, ctx->scrolled,
s->rupper, s->rlower);
@@ -2187,7 +2191,7 @@ screen_write_collect_flush_scrolled(struct screen_write_ctx *ctx)
tty_write(tty_cmd_scrollup, &ttyctx);
if (wp != NULL)
wp->flags |= PANE_REDRAWSCROLLBAR;
window_pane_scrollbar_redraw(wp);
return 1;
}