diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2011-01-23 11:04:26 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2011-01-23 11:04:26 +0000 |
commit | 153bef8c22c89b6c940ff2e45809f86e47e7b277 (patch) | |
tree | 4ffa14479c156758bd07ea8aca10be93f7036165 | |
parent | 7e53eabddc6979e4f6c798fee98409cafa0e6a25 (diff) |
Allow top-bit-set characters to be used for key bindings, from Tiago
Cunha.
-rw-r--r-- | usr.bin/tmux/key-string.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/tmux/key-string.c b/usr.bin/tmux/key-string.c index 28ab8f10733..6dc17d8ad2f 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.19 2011/01/01 03:43:20 nicm Exp $ */ +/* $OpenBSD: key-string.c,v 1.20 2011/01/23 11:04:25 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -147,7 +147,7 @@ key_string_lookup_string(const char *string) /* Is this a standard ASCII key? */ if (string[1] == '\0') { key = (u_char) string[0]; - if (key < 32 || key > 126) + if (key < 32 || key == 127 || key > 255) return (KEYC_NONE); } else { /* Otherwise look the key up in the table. */ @@ -213,7 +213,7 @@ key_string_lookup_key(int key) } /* Invalid keys are errors. */ - if (key >= 127) + if (key == 127 || key > 255) return (NULL); /* Check for standard or control key. */ @@ -225,7 +225,9 @@ key_string_lookup_key(int key) } else if (key >= 32 && key <= 126) { tmp[0] = key; tmp[1] = '\0'; - } + } else if (key >= 128) + xsnprintf(tmp, sizeof tmp, "\\%o", key); + strlcat(out, tmp, sizeof out); return (out); } |