summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-command-prompt.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2016-10-12 13:03:27 +0000
committernicm <nicm@openbsd.org>2016-10-12 13:03:27 +0000
commita3806a61b112f43ffd7a5fb5bdb9e4a6e0cfeb14 (patch)
treed86ebc459cd30e84857545f609c29b371cf188ee /usr.bin/tmux/cmd-command-prompt.c
parentcopy updated log.c from vmd: for correctness, save errno when doing (diff)
downloadwireguard-openbsd-a3806a61b112f43ffd7a5fb5bdb9e4a6e0cfeb14.tar.xz
wireguard-openbsd-a3806a61b112f43ffd7a5fb5bdb9e4a6e0cfeb14.zip
The repeat prompt in both emacs and vi (and the old one in tmux) doesn't
support line editing and instead executes a command as soon as a non-number key is pressed. Add a -N flag to command-prompt for the same in copy mode. Reported by Theo Buehler.
Diffstat (limited to 'usr.bin/tmux/cmd-command-prompt.c')
-rw-r--r--usr.bin/tmux/cmd-command-prompt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-command-prompt.c b/usr.bin/tmux/cmd-command-prompt.c
index 4b6ae959650..e5ed4d9bc85 100644
--- a/usr.bin/tmux/cmd-command-prompt.c
+++ b/usr.bin/tmux/cmd-command-prompt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-command-prompt.c,v 1.35 2016/10/11 07:23:34 nicm Exp $ */
+/* $OpenBSD: cmd-command-prompt.c,v 1.36 2016/10/12 13:03:27 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -38,8 +38,8 @@ const struct cmd_entry cmd_command_prompt_entry = {
.name = "command-prompt",
.alias = NULL,
- .args = { "1I:p:t:", 0, 1 },
- .usage = "[-1] [-I inputs] [-p prompts] " CMD_TARGET_CLIENT_USAGE " "
+ .args = { "1I:Np:t:", 0, 1 },
+ .usage = "[-1N] [-I inputs] [-p prompts] " CMD_TARGET_CLIENT_USAGE " "
"[template]",
.tflag = CMD_CLIENT,
@@ -112,6 +112,8 @@ cmd_command_prompt_exec(struct cmd *self, struct cmd_q *cmdq)
flags = 0;
if (args_has(args, '1'))
flags |= PROMPT_SINGLE;
+ else if (args_has(args, 'N'))
+ flags |= PROMPT_NUMERIC;
status_prompt_set(c, prompt, input, cmd_command_prompt_callback,
cmd_command_prompt_free, cdata, flags);
free(prompt);