From 1d604329b0ded93d18fd6b27f72c7473d1fee20f Mon Sep 17 00:00:00 2001 From: Can Celik Date: Sun, 23 Aug 2026 00:01:57 +0300 Subject: fix(windows): preserve non-us shifted text (#3055) * fix(windows): preserve non-us shifted text refs #3045 * fix(windows): retain shifted key repeat lifecycle refs #3045 --- src/pane/terminal.rs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/pane/terminal.rs') diff --git a/src/pane/terminal.rs b/src/pane/terminal.rs index f1c6e2e5..37de333b 100644 --- a/src/pane/terminal.rs +++ b/src/pane/terminal.rs @@ -4499,7 +4499,7 @@ mod tests { } #[test] - fn grouped_semantic_key_repeats_expand_at_the_destination() { + fn grouped_key_repeats_expand_at_the_destination() { let (tx, _rx) = mpsc::channel(4); let terminal = crate::ghostty::Terminal::new(80, 24, 0).unwrap(); let pane = GhosttyPaneTerminal::new(terminal, tx).unwrap(); @@ -4513,6 +4513,28 @@ mod tests { pane.encode_terminal_key(key, crate::input::KeyboardProtocol::Legacy), b"xxx" ); + + let shifted = crate::input::TerminalKey::new( + crossterm::event::KeyCode::Char('/'), + crossterm::event::KeyModifiers::SHIFT, + ) + .with_generated_text(Some("/".to_owned())) + .with_windows_record(crate::input::WindowsKeyRecord { + key_down: true, + repeat_count: 3, + virtual_key_code: 0x37, + virtual_scan_code: 0x08, + unicode: u16::from(b'/'), + control_key_state: 0x0010, + }); + assert_eq!( + pane.encode_terminal_key(shifted.clone(), crate::input::KeyboardProtocol::Legacy,), + b"///" + ); + assert_eq!( + pane.encode_terminal_key(shifted, crate::input::KeyboardProtocol::Kitty { flags: 15 },), + b"\x1b[47;2:1u\x1b[47;2:2u\x1b[47;2:2u" + ); } #[test] -- cgit v1.2.3