From c1573727f0ea1d8a2530edc1a7848d9aa1d6f590 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 20 Jun 2019 13:39:17 +0000 Subject: [PATCH 1/2] Still need to walk the options tree for user options. --- cmd-show-options.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd-show-options.c b/cmd-show-options.c index 5b22b8bd..0b9eb096 100644 --- a/cmd-show-options.c +++ b/cmd-show-options.c @@ -200,6 +200,12 @@ cmd_show_options_all(struct cmd *self, struct cmdq_item *item, int scope, u_int idx; int parent; + o = options_first(oo); + while (o != NULL) { + if (options_table_entry(o) == NULL) + cmd_show_options_print(self, item, o, -1, 0); + o = options_next(o); + } for (oe = options_table; oe->name != NULL; oe++) { if (~oe->scope & scope) continue; From fc1df91e034627f674ed905be6a1159da883545e Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 20 Jun 2019 13:40:22 +0000 Subject: [PATCH 2/2] allow-rename and alternate-screen can be pane options. --- input.c | 2 +- options-table.c | 4 ++-- tmux.1 | 43 ++++++++++++++++++++----------------------- window.c | 4 ++-- 4 files changed, 25 insertions(+), 28 deletions(-) diff --git a/input.c b/input.c index 3e85e14f..7df2a7b0 100644 --- a/input.c +++ b/input.c @@ -2259,7 +2259,7 @@ input_exit_rename(struct input_ctx *ictx) { if (ictx->flags & INPUT_DISCARD) return; - if (!options_get_number(ictx->wp->window->options, "allow-rename")) + if (!options_get_number(ictx->wp->options, "allow-rename")) return; log_debug("%s: \"%s\"", __func__, ictx->input_buf); diff --git a/options-table.c b/options-table.c index b287d660..228cf3f0 100644 --- a/options-table.c +++ b/options-table.c @@ -563,13 +563,13 @@ const struct options_table_entry options_table[] = { { .name = "allow-rename", .type = OPTIONS_TABLE_FLAG, - .scope = OPTIONS_TABLE_WINDOW, + .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE, .default_num = 0 }, { .name = "alternate-screen", .type = OPTIONS_TABLE_FLAG, - .scope = OPTIONS_TABLE_WINDOW, + .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE, .default_num = 1 }, diff --git a/tmux.1 b/tmux.1 index ec7fdc31..1315e29a 100644 --- a/tmux.1 +++ b/tmux.1 @@ -3410,29 +3410,6 @@ session; this option is good for full-screen programs which support .Dv SIGWINCH and poor for interactive programs such as shells. .Pp -.It Xo Ic allow-rename -.Op Ic on | off -.Xc -Allow programs to change the window name using a terminal escape -sequence (\eek...\ee\e\e). -The default is off. -.Pp -.It Xo Ic alternate-screen -.Op Ic on | off -.Xc -This option configures whether programs running inside -.Nm -may use the terminal alternate screen feature, which allows the -.Em smcup -and -.Em rmcup -.Xr terminfo 5 -capabilities. -The alternate screen feature preserves the contents of the window when an -interactive application starts and restores it on exit, so that any output -visible before the application starts reappears unchanged after it exits. -The default is on. -.Pp .It Xo Ic automatic-rename .Op Ic on | off .Xc @@ -3673,6 +3650,26 @@ as Shift, Alt or Ctrl. Available pane options are: .Pp .Bl -tag -width Ds -compact +.It Xo Ic allow-rename +.Op Ic on | off +.Xc +Allow programs in the pane to change the window name using a terminal escape +sequence (\eek...\ee\e\e). +.Pp +.It Xo Ic alternate-screen +.Op Ic on | off +.Xc +This option configures whether programs running inside the pane may use the +terminal alternate screen feature, which allows the +.Em smcup +and +.Em rmcup +.Xr terminfo 5 +capabilities. +The alternate screen feature preserves the contents of the window when an +interactive application starts and restores it on exit, so that any output +visible before the application starts reappears unchanged after it exits. +.Pp .It Xo Ic remain-on-exit .Op Ic on | off .Xc diff --git a/window.c b/window.c index 25784454..77ca2ce2 100644 --- a/window.c +++ b/window.c @@ -944,7 +944,7 @@ window_pane_alternate_on(struct window_pane *wp, struct grid_cell *gc, if (wp->saved_grid != NULL) return; - if (!options_get_number(wp->window->options, "alternate-screen")) + if (!options_get_number(wp->options, "alternate-screen")) return; sx = screen_size_x(s); sy = screen_size_y(s); @@ -972,7 +972,7 @@ window_pane_alternate_off(struct window_pane *wp, struct grid_cell *gc, struct screen *s = &wp->base; u_int sx, sy; - if (!options_get_number(wp->window->options, "alternate-screen")) + if (!options_get_number(wp->options, "alternate-screen")) return; /*