summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/key-string.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2013-03-22 10:30:04 +0000
committernicm <nicm@openbsd.org>2013-03-22 10:30:04 +0000
commit44f5e99db15d40d29af609a6f6716a93afe17ac4 (patch)
tree7ed6859638894a187838f33d2023e19fcfcd29c7 /usr.bin/tmux/key-string.c
parentI strongly suspect it is possible for tmux to block on detach in (diff)
downloadwireguard-openbsd-44f5e99db15d40d29af609a6f6716a93afe17ac4.tar.xz
wireguard-openbsd-44f5e99db15d40d29af609a6f6716a93afe17ac4.zip
In terminals with XT, turn on modifyOtherKeys=1 with the escape sequence
and handle the most common set. Pass them through if xterm-keys is on.
Diffstat (limited to 'usr.bin/tmux/key-string.c')
-rw-r--r--usr.bin/tmux/key-string.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.bin/tmux/key-string.c b/usr.bin/tmux/key-string.c
index 2de7682407b..0012f89771d 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.23 2012/03/04 20:40:54 nicm Exp $ */
+/* $OpenBSD: key-string.c,v 1.24 2013/03/22 10:30:04 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -136,9 +136,10 @@ key_string_get_modifiers(const char **string)
int
key_string_lookup_string(const char *string)
{
- int key, modifiers;
- u_short u;
- int size;
+ static const char *other = "!#()+,-.0123456789:;<=>?'\r\t";
+ int key, modifiers;
+ u_short u;
+ int size;
/* Is this a hexadecimal value? */
if (string[0] == '0' && string[1] == 'x') {
@@ -170,7 +171,7 @@ key_string_lookup_string(const char *string)
}
/* Convert the standard control keys. */
- if (key < KEYC_BASE && (modifiers & KEYC_CTRL)) {
+ if (key < KEYC_BASE && (modifiers & KEYC_CTRL) && !strchr(other, key)) {
if (key >= 97 && key <= 122)
key -= 96;
else if (key >= 64 && key <= 95)
@@ -193,7 +194,7 @@ key_string_lookup_key(int key)
{
static char out[24];
char tmp[8];
- u_int i;
+ u_int i;
*out = '\0';