diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-07-26 04:22:05 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-26 04:22:05 +0300 |
| commit | e536bd8bd99de975cb2d15bb384e6e35f88ef88e (patch) | |
| tree | 4de9e0d10c7b0727e693f70b4dbd7859da45f24d /src/input | |
| parent | 8843bbb0c4dc4e6b52ca5d0a6592ce80be56a19c (diff) | |
fix: support non-us shifted keybindings (#1876)
* fix: support non-us shifted keybindings
refs #1870
* docs: require current pull request base
Diffstat (limited to 'src/input')
| -rw-r--r-- | src/input/parse.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/input/parse.rs b/src/input/parse.rs index 36de52e8..e4c554f8 100644 --- a/src/input/parse.rs +++ b/src/input/parse.rs @@ -601,6 +601,22 @@ mod tests { } #[test] + fn parse_kitty_sequence_preserves_non_us_shift_pairs() { + for (sequence, base, shifted) in [ + ("\x1b[50:34;2:1u", '2', '"'), + ("\x1b[38:49;2:1u", '&', '1'), + ("\x1b[305:73;2:1u", 'ı', 'I'), + ("\x1b[287:286;2:1u", 'ğ', 'Ğ'), + ] { + let key = parse_terminal_key_sequence(sequence).unwrap(); + assert_eq!(key.code, KeyCode::Char(base)); + assert_eq!(key.modifiers, KeyModifiers::SHIFT); + assert_eq!(key.kind, crossterm::event::KeyEventKind::Press); + assert_eq!(key.shifted_codepoint, Some(shifted as u32)); + } + } + + #[test] fn parse_kitty_sequence_with_associated_emoji_text() { let key = parse_terminal_key_sequence("\x1b[128512;1;128512u").unwrap(); assert_terminal_key_eq( |
