aboutsummaryrefslogtreecommitdiff
path: root/src/client/input.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-06-07 19:45:16 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-06-07 19:45:16 +0300
commitc01b947d0bde1663980a15727938ac666ce31f61 (patch)
tree009ad30854d0112f75a0a5ae964b9a6c72ff41ee /src/client/input.rs
parent9c101b71d83941ee59d2b68f32f624afd7e2d78e (diff)
fix: support windows agent hooks and input paths
Diffstat (limited to 'src/client/input.rs')
-rw-r--r--src/client/input.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/client/input.rs b/src/client/input.rs
index bbc37a58..b89a57b1 100644
--- a/src/client/input.rs
+++ b/src/client/input.rs
@@ -180,6 +180,15 @@ fn windows_key_raw_bytes(
match key.code {
KeyCode::Esc if key.modifiers.is_empty() => Some(vec![0x1b]),
+ KeyCode::Char(ch)
+ if !raw_sequence_pending
+ && matches!(ch, 'i' | 'I')
+ && key.modifiers.contains(KeyModifiers::CONTROL)
+ && !key.modifiers.contains(KeyModifiers::ALT) =>
+ {
+ let mut buf = [0; 4];
+ Some(ch.encode_utf8(&mut buf).as_bytes().to_vec())
+ }
KeyCode::Char(ch) if raw_sequence_pending || ch.is_control() => {
let mut bytes = Vec::new();
if key.modifiers.contains(KeyModifiers::ALT) {
@@ -357,6 +366,24 @@ mod windows_tests {
}
#[test]
+ fn windows_pasted_printable_ctrl_i_routes_as_literal_i() {
+ let event = Event::Key(KeyEvent::new(KeyCode::Char('i'), KeyModifiers::CONTROL));
+ assert_eq!(
+ windows_key_raw_bytes(&event, false).as_deref(),
+ Some(b"i".as_slice())
+ );
+
+ let event = Event::Key(KeyEvent::new(
+ KeyCode::Char('I'),
+ KeyModifiers::CONTROL | KeyModifiers::SHIFT,
+ ));
+ assert_eq!(
+ windows_key_raw_bytes(&event, false).as_deref(),
+ Some(b"I".as_slice())
+ );
+ }
+
+ #[test]
fn windows_eot_control_char_normalizes_to_ctrl_d() {
let event = Event::Key(KeyEvent::new(KeyCode::Char('\u{4}'), KeyModifiers::empty()));
let bytes = windows_key_raw_bytes(&event, false).expect("eot routes through raw framer");