Merge branch 'master' into 2.6-rc

This commit is contained in:
Nicholas Marriott 2017-09-10 15:38:02 +01:00
commit abcbfcb0e8
10 changed files with 51 additions and 27 deletions

View File

@ -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. * Fix memory leak when lines with BCE are removed from history.

3
README
View File

@ -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.) 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 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 For documentation on using tmux, see the tmux.1 manpage. It can be viewed from
the source tree with: the source tree with:

View File

@ -30,8 +30,8 @@ const struct cmd_entry cmd_select_pane_entry = {
.name = "select-pane", .name = "select-pane",
.alias = "selectp", .alias = "selectp",
.args = { "DdegLlMmP:Rt:U", 0, 0 }, .args = { "DdegLlMmP:RT:t:U", 0, 0 },
.usage = "[-DdegLlMmRU] [-P style] " CMD_TARGET_PANE_USAGE, .usage = "[-DdegLlMmRU] [-P style] [-T title] " CMD_TARGET_PANE_USAGE,
.target = { 't', CMD_FIND_PANE, 0 }, .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); 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) if (wp == w->active)
return (CMD_RETURN_NORMAL); return (CMD_RETURN_NORMAL);
server_unzoom_window(wp->window); server_unzoom_window(wp->window);

View File

@ -190,7 +190,7 @@ cmd_set_option_exec(struct cmd *self, struct cmdq_item *item)
/* Change the option. */ /* Change the option. */
if (args_has(args, 'u')) { if (args_has(args, 'u')) {
if (o == NULL) if (o == NULL)
goto fail; goto out;
if (idx == -1) { if (idx == -1) {
if (oo == global_options || if (oo == global_options ||
oo == global_s_options || oo == global_s_options ||

View File

@ -1,6 +1,6 @@
# configure.ac # configure.ac
AC_INIT(tmux, 2.6-rc) AC_INIT(tmux, master)
AC_PREREQ([2.60]) AC_PREREQ([2.60])
AC_CONFIG_AUX_DIR(etc) AC_CONFIG_AUX_DIR(etc)

View File

@ -433,7 +433,7 @@ static const struct input_state input_state_rename_string = {
/* consume_st state definition. */ /* consume_st state definition. */
static const struct input_state input_state_consume_st = { static const struct input_state input_state_consume_st = {
"consume_st", "consume_st",
NULL, NULL, input_enter_rename, NULL, /* rename also waits for ST */
input_state_consume_st_table input_state_consume_st_table
}; };

View File

@ -138,12 +138,17 @@ void
key_bindings_remove_table(const char *name) key_bindings_remove_table(const char *name)
{ {
struct key_table *table; struct key_table *table;
struct client *c;
table = key_bindings_get_table(name, 0); table = key_bindings_get_table(name, 0);
if (table != NULL) { if (table != NULL) {
RB_REMOVE(key_tables, &key_tables, table); RB_REMOVE(key_tables, &key_tables, table);
key_bindings_unref_table(table); key_bindings_unref_table(table);
} }
TAILQ_FOREACH(c, &clients, entry) {
if (c->keytable == table)
server_client_set_key_table(c, NULL);
}
} }
void void

View File

@ -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 static void
mode_tree_clear_lines(struct mode_tree_data *mtd) 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) { if (i != mtd->line_size) {
mtd->current = i; mtd->current = i;
if (mtd->current > mtd->height - 1) if (mtd->current > mtd->height - 1)
mtd->offset = 1 + mtd->current - mtd->height; mtd->offset = mtd->current - mtd->height + 1;
else else
mtd->offset = 0; mtd->offset = 0;
} else { } else {
@ -361,6 +372,7 @@ mode_tree_build(struct mode_tree_data *mtd)
mtd->height = screen_size_y(s); mtd->height = screen_size_y(s);
} else } else
mtd->height = screen_size_y(s); mtd->height = screen_size_y(s);
mode_tree_check_selected(mtd);
} }
static void static void
@ -792,7 +804,7 @@ mode_tree_key(struct mode_tree_data *mtd, struct client *c, key_code *key,
case KEYC_END: case KEYC_END:
mtd->current = mtd->line_size - 1; mtd->current = mtd->line_size - 1;
if (mtd->current > mtd->height - 1) if (mtd->current > mtd->height - 1)
mtd->offset = mtd->current - mtd->height; mtd->offset = mtd->current - mtd->height + 1;
else else
mtd->offset = 0; mtd->offset = 0;
break; break;
@ -870,15 +882,8 @@ mode_tree_key(struct mode_tree_data *mtd, struct client *c, key_code *key,
case 'v': case 'v':
mtd->preview = !mtd->preview; mtd->preview = !mtd->preview;
mode_tree_build(mtd); mode_tree_build(mtd);
if (mtd->preview)
/* mode_tree_check_selected(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--;
}
break; break;
} }
return (0); return (0);

22
tmux.1
View File

@ -1927,6 +1927,7 @@ applies the last set layout if possible (undoes the most recent layout change).
.It Xo Ic select-pane .It Xo Ic select-pane
.Op Fl DdegLlMmRU .Op Fl DdegLlMmRU
.Op Fl P Ar style .Op Fl P Ar style
.Op Fl T Ar title
.Op Fl t Ar target-pane .Op Fl t Ar target-pane
.Xc .Xc
.D1 (alias: Ic selectp ) .D1 (alias: Ic selectp )
@ -1982,6 +1983,9 @@ select-pane -t:.1 -P 'bg=red'
.Pp .Pp
.Fl g .Fl g
shows the current pane style. shows the current pane style.
.Pp
.Fl T
sets the pane title.
.It Xo Ic select-window .It Xo Ic select-window
.Op Fl lnpT .Op Fl lnpT
.Op Fl t Ar target-window .Op Fl t Ar target-window
@ -2878,7 +2882,7 @@ Set the position of the status line.
Display Display
.Ar string .Ar string
to the right of the status line. 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. are shown.
As with As with
.Ic status-left , .Ic status-left ,
@ -3728,14 +3732,11 @@ and are displayed in the status line and various lists: the name is the
.Nm .Nm
identifier for a window or session. identifier for a window or session.
Only panes have titles. Only panes have titles.
A pane's title is typically set by the program running inside the pane and A pane's title is typically set by the program running inside the pane using
is not modified by an escape sequence (like it would set the
.Nm .
It is the same mechanism used to set for example the
.Xr xterm 1 .Xr xterm 1
window title in an window title in
.Xr X 7 .Xr X 7 ) .
window manager.
Windows themselves do not have titles - a window's title is the title of its Windows themselves do not have titles - a window's title is the title of its
active pane. active pane.
.Nm .Nm
@ -3776,6 +3777,11 @@ A pane's title can be set via the OSC title setting sequence, for example:
.Bd -literal -offset indent .Bd -literal -offset indent
$ printf '\e033]2;My Title\e033\e\e' $ printf '\e033]2;My Title\e033\e\e'
.Ed .Ed
.Pp
It can also be modified with the
.Ic select-pane
.Fl T
command.
.Sh ENVIRONMENT .Sh ENVIRONMENT
When the server is started, When the server is started,
.Nm .Nm

View File

@ -2454,7 +2454,7 @@ window_copy_move_mouse(struct mouse_event *m)
if (wp == NULL || wp->mode != &window_copy_mode) if (wp == NULL || wp->mode != &window_copy_mode)
return; return;
if (cmd_mouse_at(wp, m, &x, &y, 1) != 0) if (cmd_mouse_at(wp, m, &x, &y, 0) != 0)
return; return;
window_copy_update_cursor(wp, x, y); window_copy_update_cursor(wp, x, y);