mirror of
https://github.com/tmux/tmux.git
synced 2024-11-19 10:58:51 +00:00
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:
parent
fe44b105e4
commit
c0508c9321
@ -1080,6 +1080,14 @@ const struct options_table_entry options_table[] = {
|
|||||||
"remain-on-exit is enabled."
|
"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",
|
{ .name = "synchronize-panes",
|
||||||
.type = OPTIONS_TABLE_FLAG,
|
.type = OPTIONS_TABLE_FLAG,
|
||||||
.scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
|
.scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
|
||||||
|
@ -1427,7 +1427,11 @@ screen_write_clearendofscreen(struct screen_write_ctx *ctx, u_int bg)
|
|||||||
ttyctx.bg = bg;
|
ttyctx.bg = bg;
|
||||||
|
|
||||||
/* Scroll into history if it is enabled and clearing entire screen. */
|
/* 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);
|
grid_view_clear_history(gd, bg);
|
||||||
else {
|
else {
|
||||||
if (s->cx <= sx - 1)
|
if (s->cx <= sx - 1)
|
||||||
|
6
tmux.1
6
tmux.1
@ -4479,6 +4479,12 @@ Set the text shown at the bottom of exited panes when
|
|||||||
.Ic remain-on-exit
|
.Ic remain-on-exit
|
||||||
is enabled.
|
is enabled.
|
||||||
.Pp
|
.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
|
.It Xo Ic synchronize-panes
|
||||||
.Op Ic on | off
|
.Op Ic on | off
|
||||||
.Xc
|
.Xc
|
||||||
|
Loading…
Reference in New Issue
Block a user