Add an option (scroll-on-clear) to control if tmux scrolls into history

on clear, from Robert Lange in GitHub issue 3121.
This commit is contained in:
nicm
2022-03-17 11:35:37 +00:00
parent e6e737ac0b
commit 10d689e735
3 changed files with 19 additions and 1 deletions

View File

@ -1427,7 +1427,11 @@ screen_write_clearendofscreen(struct screen_write_ctx *ctx, u_int bg)
ttyctx.bg = bg;
/* Scroll into history if it is enabled and clearing entire screen. */
if (s->cx == 0 && s->cy == 0 && (gd->flags & GRID_HISTORY))
if (s->cx == 0 &&
s->cy == 0 &&
(gd->flags & GRID_HISTORY) &&
ctx->wp != NULL &&
options_get_number(ctx->wp->options, "scroll-on-clear"))
grid_view_clear_history(gd, bg);
else {
if (s->cx <= sx - 1)