version 1.31, 2021/08/23 08:17:41 |
version 1.32, 2021/08/25 08:51:55 |
|
|
* Display a menu on a client. |
* Display a menu on a client. |
*/ |
*/ |
|
|
static enum cmd_retval cmd_display_menu_exec(struct cmd *, |
static enum args_parse_type cmd_display_menu_args_parse(struct args *, |
struct cmdq_item *); |
u_int, char **); |
static enum cmd_retval cmd_display_popup_exec(struct cmd *, |
static enum cmd_retval cmd_display_menu_exec(struct cmd *, |
struct cmdq_item *); |
struct cmdq_item *); |
|
static enum cmd_retval cmd_display_popup_exec(struct cmd *, |
|
struct cmdq_item *); |
|
|
const struct cmd_entry cmd_display_menu_entry = { |
const struct cmd_entry cmd_display_menu_entry = { |
.name = "display-menu", |
.name = "display-menu", |
.alias = "menu", |
.alias = "menu", |
|
|
.args = { "c:t:OT:x:y:", 1, -1, NULL }, |
.args = { "c:t:OT:x:y:", 1, -1, cmd_display_menu_args_parse }, |
.usage = "[-O] [-c target-client] " CMD_TARGET_PANE_USAGE " [-T title] " |
.usage = "[-O] [-c target-client] " CMD_TARGET_PANE_USAGE " [-T title] " |
"[-x position] [-y position] name key command ...", |
"[-x position] [-y position] name key command ...", |
|
|
|
|
|
|
.args = { "BCc:d:Eh:t:w:x:y:", 0, -1, NULL }, |
.args = { "BCc:d:Eh:t:w:x:y:", 0, -1, NULL }, |
.usage = "[-BCE] [-c target-client] [-d start-directory] [-h height] " |
.usage = "[-BCE] [-c target-client] [-d start-directory] [-h height] " |
CMD_TARGET_PANE_USAGE " [-w width] " |
CMD_TARGET_PANE_USAGE " [-w width] " |
"[-x position] [-y position] [command]", |
"[-x position] [-y position] [shell-command]", |
|
|
.target = { 't', CMD_FIND_PANE, 0 }, |
.target = { 't', CMD_FIND_PANE, 0 }, |
|
|
.flags = CMD_AFTERHOOK|CMD_CLIENT_CFLAG, |
.flags = CMD_AFTERHOOK|CMD_CLIENT_CFLAG, |
.exec = cmd_display_popup_exec |
.exec = cmd_display_popup_exec |
}; |
}; |
|
|
|
static enum args_parse_type |
|
cmd_display_menu_args_parse(struct args *args, u_int idx, __unused char **cause) |
|
{ |
|
u_int i = 0; |
|
enum args_parse_type type = ARGS_PARSE_STRING; |
|
|
|
for (;;) { |
|
type = ARGS_PARSE_STRING; |
|
if (i == idx) |
|
break; |
|
if (*args_string(args, i++) == '\0') |
|
continue; |
|
|
|
type = ARGS_PARSE_STRING; |
|
if (i++ == idx) |
|
break; |
|
|
|
type = ARGS_PARSE_COMMANDS_OR_STRING; |
|
if (i++ == idx) |
|
break; |
|
} |
|
return (type); |
|
} |
|
|
static int |
static int |
cmd_display_menu_get_position(struct client *tc, struct cmdq_item *item, |
cmd_display_menu_get_position(struct client *tc, struct cmdq_item *item, |