aboutsummaryrefslogtreecommitdiff
path: root/cmd-send-keys.c
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-07-21 15:53:59 -0600
committerJosh Rahm <rahm@google.com>2022-07-21 15:53:59 -0600
commitb11548e3db4361cd8312ffbd27472823bdab4d62 (patch)
treea84b5cf79fb41bb60b6495c1a346bb360b224604 /cmd-send-keys.c
parent88ebf5544e995d85b2f1416a216ac7f44f719eed (diff)
parentab1d18d00febe161080b8e81331861481110809f (diff)
downloadrtmux-b11548e3db4361cd8312ffbd27472823bdab4d62.tar.gz
rtmux-b11548e3db4361cd8312ffbd27472823bdab4d62.tar.bz2
rtmux-b11548e3db4361cd8312ffbd27472823bdab4d62.zip
Merge remote-tracking branch 'origin/master' into rahm
Diffstat (limited to 'cmd-send-keys.c')
-rw-r--r--cmd-send-keys.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd-send-keys.c b/cmd-send-keys.c
index 47fa1caa..e22d94a6 100644
--- a/cmd-send-keys.c
+++ b/cmd-send-keys.c
@@ -151,7 +151,8 @@ cmd_send_keys_exec(struct cmd *self, struct cmdq_item *item)
char *cause = NULL;
if (args_has(args, 'N')) {
- np = args_strtonum(args, 'N', 1, UINT_MAX, &cause);
+ np = args_strtonum_and_expand(args, 'N', 1, UINT_MAX, item,
+ &cause);
if (cause != NULL) {
cmdq_error(item, "repeat count %s", cause);
free(cause);
@@ -203,6 +204,8 @@ cmd_send_keys_exec(struct cmd *self, struct cmdq_item *item)
}
if (count == 0) {
+ if (args_has(args, 'N') || args_has(args, 'R'))
+ return (CMD_RETURN_NORMAL);
for (; np != 0; np--)
cmd_send_keys_inject_key(item, NULL, event->key);
return (CMD_RETURN_NORMAL);