diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-04-13 17:34:13 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-04-13 17:34:13 +0300 |
| commit | 305d9577043291af271d16bdd2208f748e5949ba (patch) | |
| tree | 743a6bf9cb241b852168fa58c69dfb2848c295b5 /src/input/tests.rs | |
| parent | 99c8468d7fa45454616b75c79c017985397a2d6c (diff) | |
fix input encoding for ctrl+letter in kitty mode
Diffstat (limited to 'src/input/tests.rs')
| -rw-r--r-- | src/input/tests.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/input/tests.rs b/src/input/tests.rs index d624d28a..6e196ad7 100644 --- a/src/input/tests.rs +++ b/src/input/tests.rs @@ -295,12 +295,20 @@ fn kitty_alt_enter() { } #[test] -fn kitty_plain_ctrl_c_uses_legacy() { - // Plain Ctrl+letter is well-represented in legacy +fn kitty_plain_ctrl_c_uses_csi_u() { let key = KeyEvent::new(KeyCode::Char('c'), KeyModifiers::CONTROL); assert_eq!( encode_key(key, KeyboardProtocol::Kitty { flags: 1 }), - vec![3] + b"\x1b[99;5u" + ); +} + +#[test] +fn kitty_plain_ctrl_c_includes_press_event_when_requested() { + let key = KeyEvent::new(KeyCode::Char('c'), KeyModifiers::CONTROL); + assert_eq!( + encode_key(key, KeyboardProtocol::Kitty { flags: 3 }), + b"\x1b[99;5:1u" ); } |
