Add -N flag to display-panes to ignore keys, GitHub issue 2473.

pull/2497/head
nicm 2020-11-26 09:19:10 +00:00
parent 0d28ee9274
commit 76cfb5f471
2 changed files with 14 additions and 6 deletions

View File

@ -34,8 +34,8 @@ const struct cmd_entry cmd_display_panes_entry = {
.name = "display-panes",
.alias = "displayp",
.args = { "bd:t:", 0, 1 },
.usage = "[-b] [-d duration] " CMD_TARGET_CLIENT_USAGE " [template]",
.args = { "bd:Nt:", 0, 1 },
.usage = "[-bN] [-d duration] " CMD_TARGET_CLIENT_USAGE " [template]",
.flags = CMD_AFTERHOOK|CMD_CLIENT_TFLAG,
.exec = cmd_display_panes_exec
@ -284,8 +284,15 @@ cmd_display_panes_exec(struct cmd *self, struct cmdq_item *item)
else
cdata->item = item;
server_client_set_overlay(tc, delay, NULL, NULL, cmd_display_panes_draw,
cmd_display_panes_key, cmd_display_panes_free, cdata);
if (args_has(args, 'N')) {
server_client_set_overlay(tc, delay, NULL, NULL,
cmd_display_panes_draw, NULL, cmd_display_panes_free,
cdata);
} else {
server_client_set_overlay(tc, delay, NULL, NULL,
cmd_display_panes_draw, cmd_display_panes_key,
cmd_display_panes_free, cdata);
}
if (args_has(args, 'b'))
return (CMD_RETURN_NORMAL);

5
tmux.1
View File

@ -2098,7 +2098,7 @@ starts without the option information.
This command works only if at least one client is attached.
.It Xo
.Ic display-panes
.Op Fl b
.Op Fl bN
.Op Fl d Ar duration
.Op Fl t Ar target-client
.Op Ar template
@ -2111,7 +2111,8 @@ See the
and
.Ic display-panes-active-colour
session options.
The indicator is closed when a key is pressed or
The indicator is closed when a key is pressed (unless
.Fl N is given) or
.Ar duration
milliseconds have passed.
If