diff options
author | 2019-02-06 07:36:06 +0000 | |
---|---|---|
committer | 2019-02-06 07:36:06 +0000 | |
commit | 7018a461f4a2f8dba868306f4cb006b440c9c6d1 (patch) | |
tree | a79d5e15c9c4622b110f18342bfe9d87378d33f8 | |
parent | wrap some long lines, no change to actual content (diff) | |
download | wireguard-openbsd-7018a461f4a2f8dba868306f4cb006b440c9c6d1.tar.xz wireguard-openbsd-7018a461f4a2f8dba868306f4cb006b440c9c6d1.zip |
Add -b to display-panes like run-shell, GitHub issue 1559.
-rw-r--r-- | usr.bin/tmux/cmd-display-panes.c | 27 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.1 | 8 |
2 files changed, 25 insertions, 10 deletions
diff --git a/usr.bin/tmux/cmd-display-panes.c b/usr.bin/tmux/cmd-display-panes.c index 69b81835971..73533202da5 100644 --- a/usr.bin/tmux/cmd-display-panes.c +++ b/usr.bin/tmux/cmd-display-panes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-display-panes.c,v 1.22 2018/11/15 10:38:53 kn Exp $ */ +/* $OpenBSD: cmd-display-panes.c,v 1.23 2019/02/06 07:36:06 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -37,8 +37,8 @@ const struct cmd_entry cmd_display_panes_entry = { .name = "display-panes", .alias = "displayp", - .args = { "d:t:", 0, 1 }, - .usage = "[-d duration] " CMD_TARGET_CLIENT_USAGE " [template]", + .args = { "bd:t:", 0, 1 }, + .usage = "[-b] [-d duration] " CMD_TARGET_CLIENT_USAGE " [template]", .flags = CMD_AFTERHOOK, .exec = cmd_display_panes_exec @@ -65,7 +65,10 @@ cmd_display_panes_exec(struct cmd *self, struct cmdq_item *item) c->identify_callback_data = xstrdup(args->argv[0]); else c->identify_callback_data = xstrdup("select-pane -t '%%'"); - c->identify_callback_item = item; + if (args_has(args, 'b')) + c->identify_callback_item = NULL; + else + c->identify_callback_item = item; if (args_has(args, 'd')) { delay = args_strtonum(args, 'd', 0, UINT_MAX, &cause); @@ -78,6 +81,8 @@ cmd_display_panes_exec(struct cmd *self, struct cmdq_item *item) delay = options_get_number(s->options, "display-panes-time"); server_client_set_identify(c, delay); + if (args_has(args, 'b')) + return (CMD_RETURN_NORMAL); return (CMD_RETURN_WAIT); } @@ -115,15 +120,21 @@ cmd_display_panes_callback(struct client *c, struct window_pane *wp) cmd_list_free(cmdlist); } - if (new_item != NULL) - cmdq_insert_after(c->identify_callback_item, new_item); + if (new_item != NULL) { + if (c->identify_callback_item != NULL) + cmdq_insert_after(c->identify_callback_item, new_item); + else + cmdq_append(c, new_item); + } free(cmd); free(expanded); out: - c->identify_callback_item->flags &= ~CMDQ_WAITING; - c->identify_callback_item = NULL; + if (c->identify_callback_item != NULL) { + c->identify_callback_item->flags &= ~CMDQ_WAITING; + c->identify_callback_item = NULL; + } free(c->identify_callback_data); c->identify_callback_data = NULL; diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1 index 7191974e531..e45cb4835f0 100644 --- a/usr.bin/tmux/tmux.1 +++ b/usr.bin/tmux/tmux.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tmux.1,v 1.615 2018/11/07 07:58:16 nicm Exp $ +.\" $OpenBSD: tmux.1,v 1.616 2019/02/06 07:36:06 nicm Exp $ .\" .\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> .\" @@ -14,7 +14,7 @@ .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: November 7 2018 $ +.Dd $Mdocdate: February 6 2019 $ .Dt TMUX 1 .Os .Sh NAME @@ -1526,6 +1526,7 @@ first. This command works only if at least one client is attached. .It Xo .Ic display-panes +.Op Fl b .Op Fl d Ar duration .Op Fl t Ar target-client .Op Ar template @@ -1559,6 +1560,9 @@ substituted by the pane ID. The default .Ar template is "select-pane -t '%%'". +With +.Fl b , +other commands are not blocked from running until the indicator is closed. .It Xo Ic find-window .Op Fl CNTZ .Op Fl t Ar target-pane |