diff --git a/CHANGES b/CHANGES index 4885293c..00518f2f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,6 @@ -CHANGES FROM 2.5 TO 2.6-rc, 29 August 2017 +CHANGES FROM 2.5 TO 2.6-rc2, 10 September 2017 + +* Add select-pane -T to set pane title. * Fix memory leak when lines with BCE are removed from history. diff --git a/README b/README index 63ee1b87..056d5691 100644 --- a/README +++ b/README @@ -33,7 +33,8 @@ To get and build the latest from version control: automake, pkg-config as well as libevent and ncurses libraries and headers.) For more information see http://git-scm.com. Patches should be sent by email to -the mailing list at tmux-users@googlegroups.com. +the mailing list at tmux-users@googlegroups.com or submitted through GitHub at +https://github.com/tmux/tmux/issues. For documentation on using tmux, see the tmux.1 manpage. It can be viewed from the source tree with: diff --git a/cmd-select-pane.c b/cmd-select-pane.c index 21bda8e4..a7fb4428 100644 --- a/cmd-select-pane.c +++ b/cmd-select-pane.c @@ -30,8 +30,8 @@ const struct cmd_entry cmd_select_pane_entry = { .name = "select-pane", .alias = "selectp", - .args = { "DdegLlMmP:Rt:U", 0, 0 }, - .usage = "[-DdegLlMmRU] [-P style] " CMD_TARGET_PANE_USAGE, + .args = { "DdegLlMmP:RT:t:U", 0, 0 }, + .usage = "[-DdegLlMmRU] [-P style] [-T title] " CMD_TARGET_PANE_USAGE, .target = { 't', CMD_FIND_PANE, 0 }, @@ -147,6 +147,11 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item) return (CMD_RETURN_NORMAL); } + if (args_has(self->args, 'T')) { + screen_set_title(&wp->base, args_get(self->args, 'T')); + server_status_window(wp->window); + } + if (wp == w->active) return (CMD_RETURN_NORMAL); server_unzoom_window(wp->window); diff --git a/cmd-set-option.c b/cmd-set-option.c index 02504d5c..d1ec6fcf 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -190,7 +190,7 @@ cmd_set_option_exec(struct cmd *self, struct cmdq_item *item) /* Change the option. */ if (args_has(args, 'u')) { if (o == NULL) - goto fail; + goto out; if (idx == -1) { if (oo == global_options || oo == global_s_options || diff --git a/configure.ac b/configure.ac index de52137b..83c104c3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ # configure.ac -AC_INIT(tmux, 2.6-rc) +AC_INIT(tmux, master) AC_PREREQ([2.60]) AC_CONFIG_AUX_DIR(etc) diff --git a/input.c b/input.c index b67d2362..e4aecf7d 100644 --- a/input.c +++ b/input.c @@ -433,7 +433,7 @@ static const struct input_state input_state_rename_string = { /* consume_st state definition. */ static const struct input_state input_state_consume_st = { "consume_st", - NULL, NULL, + input_enter_rename, NULL, /* rename also waits for ST */ input_state_consume_st_table }; diff --git a/key-bindings.c b/key-bindings.c index 39083af0..badbc0f4 100644 --- a/key-bindings.c +++ b/key-bindings.c @@ -138,12 +138,17 @@ void key_bindings_remove_table(const char *name) { struct key_table *table; + struct client *c; table = key_bindings_get_table(name, 0); if (table != NULL) { RB_REMOVE(key_tables, &key_tables, table); key_bindings_unref_table(table); } + TAILQ_FOREACH(c, &clients, entry) { + if (c->keytable == table) + server_client_set_key_table(c, NULL); + } } void diff --git a/mode-tree.c b/mode-tree.c index fc31592a..ad783bb4 100644 --- a/mode-tree.c +++ b/mode-tree.c @@ -127,6 +127,17 @@ mode_tree_free_items(struct mode_tree_list *mtl) } } +static void +mode_tree_check_selected(struct mode_tree_data *mtd) +{ + /* + * If the current line would now be off screen reset the offset to the + * last visible line. + */ + if (mtd->current > mtd->height - 1) + mtd->offset = mtd->current - mtd->height + 1; +} + static void mode_tree_clear_lines(struct mode_tree_data *mtd) { @@ -192,7 +203,7 @@ mode_tree_set_current(struct mode_tree_data *mtd, uint64_t tag) if (i != mtd->line_size) { mtd->current = i; if (mtd->current > mtd->height - 1) - mtd->offset = 1 + mtd->current - mtd->height; + mtd->offset = mtd->current - mtd->height + 1; else mtd->offset = 0; } else { @@ -361,6 +372,7 @@ mode_tree_build(struct mode_tree_data *mtd) mtd->height = screen_size_y(s); } else mtd->height = screen_size_y(s); + mode_tree_check_selected(mtd); } static void @@ -792,7 +804,7 @@ mode_tree_key(struct mode_tree_data *mtd, struct client *c, key_code *key, case KEYC_END: mtd->current = mtd->line_size - 1; if (mtd->current > mtd->height - 1) - mtd->offset = mtd->current - mtd->height; + mtd->offset = mtd->current - mtd->height + 1; else mtd->offset = 0; break; @@ -870,15 +882,8 @@ mode_tree_key(struct mode_tree_data *mtd, struct client *c, key_code *key, case 'v': mtd->preview = !mtd->preview; mode_tree_build(mtd); - - /* - * If the current line would now be off screen now the preview - * is on, reset the the offset to the last visible line. - */ - if (mtd->preview && mtd->current > mtd->height - 1) { - mtd->offset = mtd->current - mtd->height; - mtd->current--; - } + if (mtd->preview) + mode_tree_check_selected(mtd); break; } return (0); diff --git a/tmux.1 b/tmux.1 index 833399e0..08c67a6f 100644 --- a/tmux.1 +++ b/tmux.1 @@ -1927,6 +1927,7 @@ applies the last set layout if possible (undoes the most recent layout change). .It Xo Ic select-pane .Op Fl DdegLlMmRU .Op Fl P Ar style +.Op Fl T Ar title .Op Fl t Ar target-pane .Xc .D1 (alias: Ic selectp ) @@ -1982,6 +1983,9 @@ select-pane -t:.1 -P 'bg=red' .Pp .Fl g shows the current pane style. +.Pp +.Fl T +sets the pane title. .It Xo Ic select-window .Op Fl lnpT .Op Fl t Ar target-window @@ -2878,7 +2882,7 @@ Set the position of the status line. Display .Ar string to the right of the status line. -By default, the current window title in double quotes, the date and the time +By default, the current pane title in double quotes, the date and the time are shown. As with .Ic status-left , @@ -3728,14 +3732,11 @@ and are displayed in the status line and various lists: the name is the .Nm identifier for a window or session. Only panes have titles. -A pane's title is typically set by the program running inside the pane and -is not modified by -.Nm . -It is the same mechanism used to set for example the +A pane's title is typically set by the program running inside the pane using +an escape sequence (like it would set the .Xr xterm 1 -window title in an -.Xr X 7 -window manager. +window title in +.Xr X 7 ) . Windows themselves do not have titles - a window's title is the title of its active pane. .Nm @@ -3776,6 +3777,11 @@ A pane's title can be set via the OSC title setting sequence, for example: .Bd -literal -offset indent $ printf '\e033]2;My Title\e033\e\e' .Ed +.Pp +It can also be modified with the +.Ic select-pane +.Fl T +command. .Sh ENVIRONMENT When the server is started, .Nm diff --git a/window-copy.c b/window-copy.c index 4bd9d127..7ab26262 100644 --- a/window-copy.c +++ b/window-copy.c @@ -2454,7 +2454,7 @@ window_copy_move_mouse(struct mouse_event *m) if (wp == NULL || wp->mode != &window_copy_mode) return; - if (cmd_mouse_at(wp, m, &x, &y, 1) != 0) + if (cmd_mouse_at(wp, m, &x, &y, 0) != 0) return; window_copy_update_cursor(wp, x, y);