aboutsummaryrefslogtreecommitdiff
path: root/src/pane
diff options
context:
space:
mode:
Diffstat (limited to 'src/pane')
-rw-r--r--src/pane/terminal.rs24
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]