aboutsummaryrefslogtreecommitdiff
path: root/cmd-command-prompt.c
diff options
context:
space:
mode:
authornicm <nicm>2020-05-16 15:16:36 +0000
committernicm <nicm>2020-05-16 15:16:36 +0000
commit463864f5a25a0015a4f2795ba8a14e0e0bb2fa7a (patch)
tree81fde9d1bcd05f9a76c56ccc146ceb8311a8666e /cmd-command-prompt.c
parent2391fe23ab09cfe8667abdcc3338a958ab3da31d (diff)
downloadrtmux-463864f5a25a0015a4f2795ba8a14e0e0bb2fa7a.tar.gz
rtmux-463864f5a25a0015a4f2795ba8a14e0e0bb2fa7a.tar.bz2
rtmux-463864f5a25a0015a4f2795ba8a14e0e0bb2fa7a.zip
Add -W and -T flags to command-prompt to only complete a window and a
target, also complete aliases.
Diffstat (limited to 'cmd-command-prompt.c')
-rw-r--r--cmd-command-prompt.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd-command-prompt.c b/cmd-command-prompt.c
index e53c4320..b8e3bd5c 100644
--- a/cmd-command-prompt.c
+++ b/cmd-command-prompt.c
@@ -40,8 +40,8 @@ const struct cmd_entry cmd_command_prompt_entry = {
.name = "command-prompt",
.alias = NULL,
- .args = { "1kiI:Np:t:", 0, 1 },
- .usage = "[-1kiN] [-I inputs] [-p prompts] " CMD_TARGET_CLIENT_USAGE " "
+ .args = { "1kiI:Np:Tt:W", 0, 1 },
+ .usage = "[-1kiNTW] [-I inputs] [-p prompts] " CMD_TARGET_CLIENT_USAGE " "
"[template]",
.flags = CMD_CLIENT_TFLAG,
@@ -121,6 +121,10 @@ cmd_command_prompt_exec(struct cmd *self, struct cmdq_item *item)
cdata->flags |= PROMPT_INCREMENTAL;
else if (args_has(args, 'k'))
cdata->flags |= PROMPT_KEY;
+ else if (args_has(args, 'W'))
+ cdata->flags |= PROMPT_WINDOW;
+ else if (args_has(args, 'T'))
+ cdata->flags |= PROMPT_TARGET;
status_prompt_set(tc, prompt, input, cmd_command_prompt_callback,
cmd_command_prompt_free, cdata, cdata->flags);
free(prompt);