From fa0e380e627644f269cfbd0ed4cf79f15ff74176 Mon Sep 17 00:00:00 2001 From: kangal-bot Date: Mon, 18 May 2026 20:13:19 +0300 Subject: fix: preserve alt backspace in panes (#165) refs #155 Co-authored-by: kangal-bot --- src/input/encode.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/input/encode.rs') diff --git a/src/input/encode.rs b/src/input/encode.rs index 81454ddc..ea7949aa 100644 --- a/src/input/encode.rs +++ b/src/input/encode.rs @@ -523,6 +523,12 @@ mod tests { assert_eq!(encode_key(key, KeyboardProtocol::Legacy), b"\x1ba"); } + #[test] + fn legacy_alt_backspace_sends_escape_delete() { + let key = KeyEvent::new(KeyCode::Backspace, KeyModifiers::ALT); + assert_eq!(encode_key(key, KeyboardProtocol::Legacy), b"\x1b\x7f"); + } + #[test] fn application_cursor_keys_use_ss3_sequences() { assert_eq!(encode_cursor_key(KeyCode::Up, true), b"\x1bOA"); @@ -638,6 +644,15 @@ mod tests { ); } + #[test] + fn kitty_alt_backspace_uses_csi_u() { + let key = KeyEvent::new(KeyCode::Backspace, KeyModifiers::ALT); + assert_eq!( + encode_key(key, KeyboardProtocol::Kitty { flags: 1 }), + b"\x1b[127;3u" + ); + } + #[test] fn kitty_plain_ctrl_c_uses_csi_u() { let key = KeyEvent::new(KeyCode::Char('c'), KeyModifiers::CONTROL); -- cgit v1.2.3