mirror of
https://github.com/tmux/tmux.git
synced 2026-10-08 19:14:20 +00:00
Fix Kitty key encoding: legacy fallback, F3, case, send-keys drop.
This commit is contained in:
13
input-keys.c
13
input-keys.c
@@ -485,6 +485,7 @@ input_key_vt10x(struct bufferevent *bev, key_code key)
|
||||
struct utf8_data ud;
|
||||
key_code onlykey;
|
||||
const char *p;
|
||||
int meta;
|
||||
static const char *standard_map[2] = {
|
||||
"1!9(0)=+;:'\",<.>/-8? 2",
|
||||
"119900=+;;'',,..\x1f\x1f\x7f\x7f\0\0",
|
||||
@@ -492,14 +493,20 @@ input_key_vt10x(struct bufferevent *bev, key_code key)
|
||||
|
||||
log_debug("%s: key in %llx", __func__, key);
|
||||
|
||||
if (key & KEYC_META)
|
||||
input_key_write(__func__, bev, "\033", 1);
|
||||
/*
|
||||
* Remember whether Meta was set and write its ESC prefix only once
|
||||
* the key below it is known to be encodable, so a key that turns
|
||||
* out to fail does not leave a stray ESC in the pane.
|
||||
*/
|
||||
meta = !!(key & KEYC_META);
|
||||
|
||||
/*
|
||||
* There's no way to report modifiers for unicode keys in standard mode
|
||||
* so lose the modifiers.
|
||||
*/
|
||||
if (KEYC_IS_UNICODE(key)) {
|
||||
if (meta)
|
||||
input_key_write(__func__, bev, "\033", 1);
|
||||
utf8_to_data(key, &ud);
|
||||
input_key_write(__func__, bev, ud.data, ud.size);
|
||||
return (0);
|
||||
@@ -536,6 +543,8 @@ input_key_vt10x(struct bufferevent *bev, key_code key)
|
||||
|
||||
log_debug("%s: key out %llx", __func__, key);
|
||||
|
||||
if (meta)
|
||||
input_key_write(__func__, bev, "\033", 1);
|
||||
ud.data[0] = key & 0x7f;
|
||||
input_key_write(__func__, bev, &ud.data[0], 1);
|
||||
return (0);
|
||||
|
||||
Reference in New Issue
Block a user