mirror of
https://github.com/wez/wezterm.git
synced 2024-12-24 22:01:47 +03:00
fixup kitty keyup events for alphabetical keys
refs: https://github.com/wez/wezterm/issues/3220
This commit is contained in:
parent
d239e65e64
commit
8bb39bd6f3
@ -340,7 +340,10 @@ impl KeyCode {
|
||||
c => *c,
|
||||
};
|
||||
|
||||
if mods.is_empty() && !flags.contains(KittyKeyboardFlags::REPORT_ALL_KEYS_AS_ESCAPE_CODES) {
|
||||
if mods.is_empty()
|
||||
&& !flags.contains(KittyKeyboardFlags::REPORT_ALL_KEYS_AS_ESCAPE_CODES)
|
||||
&& is_down
|
||||
{
|
||||
// Check for simple text generating keys
|
||||
match key {
|
||||
Enter => return Ok("\r".to_string()),
|
||||
@ -2078,6 +2081,32 @@ mod test {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn encode_issue_3220() {
|
||||
let mode = KeyCodeEncodeModes {
|
||||
encoding: KeyboardEncoding::Kitty(
|
||||
KittyKeyboardFlags::DISAMBIGUATE_ESCAPE_CODES
|
||||
| KittyKeyboardFlags::REPORT_EVENT_TYPES,
|
||||
),
|
||||
newline_mode: false,
|
||||
application_cursor_keys: false,
|
||||
modify_other_keys: None,
|
||||
};
|
||||
|
||||
assert_eq!(
|
||||
KeyCode::Char('o')
|
||||
.encode(Modifiers::NONE, mode, true)
|
||||
.unwrap(),
|
||||
"o".to_string()
|
||||
);
|
||||
assert_eq!(
|
||||
KeyCode::Char('o')
|
||||
.encode(Modifiers::NONE, mode, false)
|
||||
.unwrap(),
|
||||
"\x1b[111;1:3u".to_string()
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn encode_issue_3473() {
|
||||
let mode = KeyCodeEncodeModes {
|
||||
|
Loading…
Reference in New Issue
Block a user