aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicm <nicm>2021-10-05 12:49:37 +0000
committernicm <nicm>2021-10-05 12:49:37 +0000
commit9f6164a05cc0de372f6859127f72c8b242596bf5 (patch)
tree399ff9a6396aada18e7d3bd0bc5c99eb03c0fb10
parent9b1fdb291ee8e940311a51cf41f97b07930b4688 (diff)
downloadrtmux-9f6164a05cc0de372f6859127f72c8b242596bf5.tar.gz
rtmux-9f6164a05cc0de372f6859127f72c8b242596bf5.tar.bz2
rtmux-9f6164a05cc0de372f6859127f72c8b242596bf5.zip
Make send-keys without any arguments send the key it is bound to (if
any). GitHub issue 2904.
-rw-r--r--cmd-send-keys.c6
-rw-r--r--tmux.11
2 files changed, 7 insertions, 0 deletions
diff --git a/cmd-send-keys.c b/cmd-send-keys.c
index 44b796ba..47fa1caa 100644
--- a/cmd-send-keys.c
+++ b/cmd-send-keys.c
@@ -202,6 +202,12 @@ cmd_send_keys_exec(struct cmd *self, struct cmdq_item *item)
wp->flags |= (PANE_STYLECHANGED|PANE_REDRAW);
}
+ if (count == 0) {
+ for (; np != 0; np--)
+ cmd_send_keys_inject_key(item, NULL, event->key);
+ return (CMD_RETURN_NORMAL);
+ }
+
for (; np != 0; np--) {
for (i = 0; i < count; i++) {
after = cmd_send_keys_inject_string(item, after, args,
diff --git a/tmux.1 b/tmux.1
index d48415fe..46611df2 100644
--- a/tmux.1
+++ b/tmux.1
@@ -3123,6 +3123,7 @@ or
to send; if the string is not recognised as a key, it is sent as a series of
characters.
All arguments are sent sequentially from first to last.
+If no keys are given and the command is bound to a key, then that key is used.
.Pp
The
.Fl l