From a1986c59739c4577545bec6b30d620d29d5747aa Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 30 Aug 2017 21:23:26 +0100 Subject: Add to CHANGES. --- CHANGES | 4 ++++ configure.ac | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index cc49e53c..4885293c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ CHANGES FROM 2.5 TO 2.6-rc, 29 August 2017 +* Fix memory leak when lines with BCE are removed from history. + +* Fix (again) the "prefer unattached" behaviour of attach-session. + * Reorder how keys are checked to allow keys to be specified that have a leading escape. GitHub issue 1048. 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) -- cgit From e941e532fac25237a7902ebda7e36a5c86c4e638 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 30 Aug 2017 21:49:31 +0100 Subject: Mention GitHub for code. --- README | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: -- cgit From f4848b437f01e92ee5414f9480f67c1026c36f6f Mon Sep 17 00:00:00 2001 From: nicm Date: Sat, 2 Sep 2017 17:51:54 +0000 Subject: Add selectp -T to set pane title. --- cmd-select-pane.c | 9 +++++++-- tmux.1 | 22 ++++++++++++++-------- 2 files changed, 21 insertions(+), 10 deletions(-) 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/tmux.1 b/tmux.1 index 3e6e6091..387c1e51 100644 --- a/tmux.1 +++ b/tmux.1 @@ -1923,6 +1923,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 ) @@ -1978,6 +1979,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 @@ -2874,7 +2878,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 , @@ -3722,14 +3726,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 Ns ). Windows themselves do not have titles - a window's title is the title of its active pane. .Nm @@ -3770,6 +3771,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 -- cgit From eadd79acec159a68db797521e361575d0c6ade20 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 4 Sep 2017 09:18:51 +0000 Subject: Move to current mouse position not last when clcking in copy mode; fixes GitHub issue 1055. Also a man page fix from jmc. --- tmux.1 | 2 +- window-copy.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tmux.1 b/tmux.1 index 387c1e51..112f5392 100644 --- a/tmux.1 +++ b/tmux.1 @@ -3730,7 +3730,7 @@ 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 -.Xr X 7 Ns ). +.Xr X 7 ) . Windows themselves do not have titles - a window's title is the title of its active pane. .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); -- cgit From 466066c3a1393bb2c485b0cfc616b5d9e0afc5f9 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 6 Sep 2017 07:12:41 +0000 Subject: Do not attempt to use TIOCSWINSZ on a -1 file descriptor (possible if the pane has already died). --- server-client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server-client.c b/server-client.c index 2263deca..0b4146a8 100644 --- a/server-client.c +++ b/server-client.c @@ -1069,7 +1069,7 @@ server_client_resize_force(struct window_pane *wp) memset(&ws, 0, sizeof ws); ws.ws_col = wp->sx; ws.ws_row = wp->sy - 1; - if (ioctl(wp->fd, TIOCSWINSZ, &ws) == -1) + if (wp->fd != -1 && ioctl(wp->fd, TIOCSWINSZ, &ws) == -1) fatal("ioctl failed"); log_debug("%s: %%%u forcing resize", __func__, wp->id); @@ -1095,7 +1095,7 @@ server_client_resize_event(__unused int fd, __unused short events, void *data) memset(&ws, 0, sizeof ws); ws.ws_col = wp->sx; ws.ws_row = wp->sy; - if (ioctl(wp->fd, TIOCSWINSZ, &ws) == -1) + if (wp->fd != -1 && ioctl(wp->fd, TIOCSWINSZ, &ws) == -1) fatal("ioctl failed"); log_debug("%s: %%%u resize to %u,%u", __func__, wp->id, wp->sx, wp->sy); -- cgit From 89e057dc4a8410207d3888e901eb3a3062002190 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 7 Sep 2017 13:18:44 +0000 Subject: Do not fail if unset an option that is already unset, reported by Thomas Sattler. --- cmd-set-option.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 || -- cgit From 78cf3c14ca44bbbebd3fcb374c0397c72caf6c78 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 8 Sep 2017 08:45:27 +0000 Subject: When removing a key table clear it out of clients, fixes issue with unbind -a reported by Thomas Sattler. --- key-bindings.c | 5 +++++ 1 file changed, 5 insertions(+) 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 -- cgit From c62cfe64c8aabd91ea977950b63a3bc956015143 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 8 Sep 2017 14:22:34 +0100 Subject: Add to CHANGES. --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 4885293c..92298ddc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ CHANGES FROM 2.5 TO 2.6-rc, 29 August 2017 +* Add select-pane -T to set pane title. + * Fix memory leak when lines with BCE are removed from history. * Fix (again) the "prefer unattached" behaviour of attach-session. -- cgit From f56f09ea3871d3099dd31030501b982a4243a372 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 8 Sep 2017 16:28:41 +0000 Subject: Fix a few errors in how the selected line is chosen after resize, reported by Felix Rosencrantz in GitHub issue 1059. --- mode-tree.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) 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); -- cgit From 8405fcdd9b62e22003923a22edfefdaf42883a98 Mon Sep 17 00:00:00 2001 From: nicm Date: Sun, 10 Sep 2017 08:01:23 +0000 Subject: Apply timeout to CAN and RS which also wait for ST. --- input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }; -- cgit