mirror of
https://github.com/tmux/tmux.git
synced 2025-01-26 07:58:55 +00:00
Make bind-key accept characters with the top-bit-set and print them as octal.
This commit is contained in:
parent
e3defd9b25
commit
ec3a764c76
10
key-string.c
10
key-string.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: key-string.c,v 1.35 2011-01-03 23:32:04 tcunha Exp $ */
|
/* $Id: key-string.c,v 1.36 2011-01-22 22:31:09 tcunha Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* 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? */
|
/* Is this a standard ASCII key? */
|
||||||
if (string[1] == '\0') {
|
if (string[1] == '\0') {
|
||||||
key = (u_char) string[0];
|
key = (u_char) string[0];
|
||||||
if (key < 32 || key > 126)
|
if (key < 32 || key == 127 || key > 255)
|
||||||
return (KEYC_NONE);
|
return (KEYC_NONE);
|
||||||
} else {
|
} else {
|
||||||
/* Otherwise look the key up in the table. */
|
/* Otherwise look the key up in the table. */
|
||||||
@ -213,7 +213,7 @@ key_string_lookup_key(int key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Invalid keys are errors. */
|
/* Invalid keys are errors. */
|
||||||
if (key >= 127)
|
if (key == 127 || key > 255)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
/* Check for standard or control key. */
|
/* Check for standard or control key. */
|
||||||
@ -225,7 +225,9 @@ key_string_lookup_key(int key)
|
|||||||
} else if (key >= 32 && key <= 126) {
|
} else if (key >= 32 && key <= 126) {
|
||||||
tmp[0] = key;
|
tmp[0] = key;
|
||||||
tmp[1] = '\0';
|
tmp[1] = '\0';
|
||||||
}
|
} else if (key >= 128)
|
||||||
|
xsnprintf(tmp, sizeof tmp, "\\%o", key);
|
||||||
|
|
||||||
strlcat(out, tmp, sizeof out);
|
strlcat(out, tmp, sizeof out);
|
||||||
return (out);
|
return (out);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user