diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-08-23 00:01:57 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-23 00:01:57 +0300 |
| commit | 1d604329b0ded93d18fd6b27f72c7473d1fee20f (patch) | |
| tree | 2ac419b930b57c232b3e7bc8921beebfa1b997bb /src/pane/terminal.rs | |
| parent | c714e4c20e3272c21722a6f083fc2d592c244385 (diff) | |
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
Diffstat (limited to 'src/pane/terminal.rs')
| -rw-r--r-- | src/pane/terminal.rs | 24 |
1 files changed, 23 insertions, 1 deletions
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] |
