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

This commit is contained in:
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", .name = "display-panes",
.alias = "displayp", .alias = "displayp",
.args = { "bd:t:", 0, 1 }, .args = { "bd:Nt:", 0, 1 },
.usage = "[-b] [-d duration] " CMD_TARGET_CLIENT_USAGE " [template]", .usage = "[-bN] [-d duration] " CMD_TARGET_CLIENT_USAGE " [template]",
.flags = CMD_AFTERHOOK|CMD_CLIENT_TFLAG, .flags = CMD_AFTERHOOK|CMD_CLIENT_TFLAG,
.exec = cmd_display_panes_exec .exec = cmd_display_panes_exec
@ -284,8 +284,15 @@ cmd_display_panes_exec(struct cmd *self, struct cmdq_item *item)
else else
cdata->item = item; cdata->item = item;
server_client_set_overlay(tc, delay, NULL, NULL, cmd_display_panes_draw, if (args_has(args, 'N')) {
cmd_display_panes_key, cmd_display_panes_free, cdata); 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')) if (args_has(args, 'b'))
return (CMD_RETURN_NORMAL); 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. This command works only if at least one client is attached.
.It Xo .It Xo
.Ic display-panes .Ic display-panes
.Op Fl b .Op Fl bN
.Op Fl d Ar duration .Op Fl d Ar duration
.Op Fl t Ar target-client .Op Fl t Ar target-client
.Op Ar template .Op Ar template
@ -2111,7 +2111,8 @@ See the
and and
.Ic display-panes-active-colour .Ic display-panes-active-colour
session options. 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 .Ar duration
milliseconds have passed. milliseconds have passed.
If If