diff options
author | Thomas Adam <thomas@xteddy.org> | 2022-03-17 16:01:11 +0000 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2022-03-17 16:01:11 +0000 |
commit | 964deae422e4127a64f60fa3b54e2bf47b8e074c (patch) | |
tree | edf36ccec813a07b04474272b317191211e08ba9 | |
parent | 5d4c3ef762d9073510518c24b40c1d8bf12e0b65 (diff) | |
parent | 6a1706a62fb2442326cd37d84ff8b0d39bf0b7a6 (diff) | |
download | rtmux-964deae422e4127a64f60fa3b54e2bf47b8e074c.tar.gz rtmux-964deae422e4127a64f60fa3b54e2bf47b8e074c.tar.bz2 rtmux-964deae422e4127a64f60fa3b54e2bf47b8e074c.zip |
Merge branch 'obsd-master' into master
-rw-r--r-- | options-table.c | 8 | ||||
-rw-r--r-- | screen-write.c | 10 | ||||
-rw-r--r-- | tmux.1 | 6 |
3 files changed, 22 insertions, 2 deletions
diff --git a/options-table.c b/options-table.c index 3aa72e78..a816f6ac 100644 --- a/options-table.c +++ b/options-table.c @@ -1080,6 +1080,14 @@ const struct options_table_entry options_table[] = { "remain-on-exit is enabled." }, + { .name = "scroll-on-clear", + .type = OPTIONS_TABLE_FLAG, + .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE, + .default_num = 1, + .text = "Whether the contents of the screen should be scrolled into" + "history when clearing the whole screen." + }, + { .name = "synchronize-panes", .type = OPTIONS_TABLE_FLAG, .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE, diff --git a/screen-write.c b/screen-write.c index 0d70f668..6b6a750e 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) @@ -1475,7 +1479,9 @@ screen_write_clearscreen(struct screen_write_ctx *ctx, u_int bg) ttyctx.bg = bg; /* Scroll into history if it is enabled. */ - if (s->grid->flags & GRID_HISTORY) + if ((s->grid->flags & GRID_HISTORY) && + ctx->wp != NULL && + options_get_number(ctx->wp->options, "scroll-on-clear")) grid_view_clear_history(s->grid, bg); else grid_view_clear(s->grid, 0, 0, sx, sy, bg); @@ -4479,6 +4479,12 @@ Set the text shown at the bottom of exited panes when .Ic remain-on-exit is enabled. .Pp +.It Xo Ic scroll-on-clear +.Op Ic on | off +.Xc +When the entire screen is cleared and this option is on, scroll the contents of +the screen into history before clearing it. +.Pp .It Xo Ic synchronize-panes .Op Ic on | off .Xc |