summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/key-string.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2019-07-09 14:03:12 +0000
committernicm <nicm@openbsd.org>2019-07-09 14:03:12 +0000
commita02c6cc0de6910021ed6426ac8e294cc43abf010 (patch)
tree5277a2ff17a84beab7008df3636e4574fcb04aef /usr.bin/tmux/key-string.c
parentadd a test using fault injection to trigger OpenBSD::Temp errors (diff)
downloadwireguard-openbsd-a02c6cc0de6910021ed6426ac8e294cc43abf010.tar.xz
wireguard-openbsd-a02c6cc0de6910021ed6426ac8e294cc43abf010.zip
Add a -H flag to send-keys to send literal keys given as hex numbers
(needed for control clients to send mouse sequences). Also add some format flags for UTF-8 and SGR mouse mode. Requested by Bradley Smith in GitHub issues 1832 and 1833.
Diffstat (limited to 'usr.bin/tmux/key-string.c')
-rw-r--r--usr.bin/tmux/key-string.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/tmux/key-string.c b/usr.bin/tmux/key-string.c
index 2dd9de128bc..49095e01dd2 100644
--- a/usr.bin/tmux/key-string.c
+++ b/usr.bin/tmux/key-string.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: key-string.c,v 1.50 2018/10/18 08:38:01 nicm Exp $ */
+/* $OpenBSD: key-string.c,v 1.51 2019/07/09 14:03:12 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -284,6 +284,12 @@ key_string_lookup_key(key_code key)
return (out);
}
+ /* Literal keys are themselves. */
+ if (key & KEYC_LITERAL) {
+ snprintf(out, sizeof out, "%c", (int)(key & 0xff));
+ return (out);
+ }
+
/*
* Special case: display C-@ as C-Space. Could do this below in
* the (key >= 0 && key <= 32), but this way we let it be found