diff options
author | nicm <nicm> | 2022-03-17 11:35:37 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2022-04-06 14:19:51 +0100 |
commit | c0508c9321d2bd3b94a850d953db9532854b45cd (patch) | |
tree | e9fb4edc47ef2e11cc99f4034a6dcd0eed6a97fb /screen-write.c | |
parent | fe44b105e4a2d1d7baa12b37d0b84d8c6be9addc (diff) | |
download | rtmux-c0508c9321d2bd3b94a850d953db9532854b45cd.tar.gz rtmux-c0508c9321d2bd3b94a850d953db9532854b45cd.tar.bz2 rtmux-c0508c9321d2bd3b94a850d953db9532854b45cd.zip |
Add an option (scroll-on-clear) to control if tmux scrolls into history
on clear, from Robert Lange in GitHub issue 3121.
Diffstat (limited to 'screen-write.c')
-rw-r--r-- | screen-write.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/screen-write.c b/screen-write.c index 0d70f668..aa898f78 100644 --- a/screen-write.c +++ b/screen-write.c @@ -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) |