From addeb9e248d157ca694ac4c3e1cb4fbff1cca66b Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 15 Apr 2023 15:50:50 -0700 Subject: [PATCH] add test case for #3526 --- wezterm-input-types/src/lib.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/wezterm-input-types/src/lib.rs b/wezterm-input-types/src/lib.rs index 18cd366f3..e8eec697e 100644 --- a/wezterm-input-types/src/lib.rs +++ b/wezterm-input-types/src/lib.rs @@ -2644,4 +2644,35 @@ mod test { "\x1b[1092:1060:97;6;1060u".to_string() ); } + + #[test] + fn encode_issue_3526() { + let flags = KittyKeyboardFlags::DISAMBIGUATE_ESCAPE_CODES; + + assert_eq!( + KeyEvent { + key: KeyCode::Char(' '), + modifiers: Modifiers::NONE, + leds: KeyboardLedStatus::NUM_LOCK, + repeat_count: 1, + key_is_down: true, + raw: None + } + .encode_kitty(flags), + " ".to_string() + ); + + assert_eq!( + KeyEvent { + key: KeyCode::Char(' '), + modifiers: Modifiers::NONE, + leds: KeyboardLedStatus::CAPS_LOCK, + repeat_count: 1, + key_is_down: true, + raw: None + } + .encode_kitty(flags), + " ".to_string() + ); + } }