mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 04:27:00 +00:00
UTF-8 keys now contain the internal representation and not the Unicode
codepoint, so convert extended keys properly. From Stanislav Kljuhhin.
This commit is contained in:
11
tty-keys.c
11
tty-keys.c
@ -911,6 +911,8 @@ tty_keys_extended_key(struct tty *tty, const char *buf, size_t len,
|
||||
cc_t bspace;
|
||||
key_code nkey;
|
||||
key_code onlykey;
|
||||
struct utf8_data ud;
|
||||
utf8_char uc;
|
||||
|
||||
*size = 0;
|
||||
|
||||
@ -960,6 +962,15 @@ tty_keys_extended_key(struct tty *tty, const char *buf, size_t len,
|
||||
else
|
||||
nkey = number;
|
||||
|
||||
/* Convert UTF-32 codepoint into internal representation. */
|
||||
if (nkey & ~0x7f) {
|
||||
if (utf8_fromwc(nkey, &ud) == UTF8_DONE &&
|
||||
utf8_from_data(&ud, &uc) == UTF8_DONE)
|
||||
nkey = uc;
|
||||
else
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Update the modifiers. */
|
||||
if (modifiers > 0) {
|
||||
modifiers--;
|
||||
|
Reference in New Issue
Block a user