version 1.19, 2017/04/22 10:22:39 |
version 1.20, 2017/08/16 12:12:54 |
|
|
.name = "display-panes", |
.name = "display-panes", |
.alias = "displayp", |
.alias = "displayp", |
|
|
.args = { "t:", 0, 1 }, |
.args = { "d:t:", 0, 1 }, |
.usage = CMD_TARGET_CLIENT_USAGE, |
.usage = "[-d duration] " CMD_TARGET_CLIENT_USAGE, |
|
|
.flags = CMD_AFTERHOOK, |
.flags = CMD_AFTERHOOK, |
.exec = cmd_display_panes_exec |
.exec = cmd_display_panes_exec |
|
|
{ |
{ |
struct args *args = self->args; |
struct args *args = self->args; |
struct client *c; |
struct client *c; |
|
struct session *s; |
|
u_int delay; |
|
char *cause; |
|
|
if ((c = cmd_find_client(item, args_get(args, 't'), 0)) == NULL) |
if ((c = cmd_find_client(item, args_get(args, 't'), 0)) == NULL) |
return (CMD_RETURN_ERROR); |
return (CMD_RETURN_ERROR); |
|
|
c->identify_callback_data = xstrdup(args->argv[0]); |
c->identify_callback_data = xstrdup(args->argv[0]); |
else |
else |
c->identify_callback_data = xstrdup("select-pane -t '%%'"); |
c->identify_callback_data = xstrdup("select-pane -t '%%'"); |
|
s = c->session; |
|
|
server_client_set_identify(c); |
if (args_has(args, 'd')) { |
|
delay = args_strtonum(args, 'd', 0, UINT_MAX, &cause); |
|
if (cause != NULL) { |
|
cmdq_error(item, "delay %s", cause); |
|
free(cause); |
|
return (CMD_RETURN_ERROR); |
|
} |
|
} else |
|
delay = options_get_number(s->options, "display-panes-time"); |
|
server_client_set_identify(c, delay); |
|
|
return (CMD_RETURN_NORMAL); |
return (CMD_RETURN_NORMAL); |
} |
} |