summaryrefslogtreecommitdiff
path: root/src/input/encode.rs
diff options
context:
space:
mode:
authorkangal-bot <kangal@herdr.dev>2026-05-18 20:13:19 +0300
committerGitHub <noreply@github.com>2026-05-18 20:13:19 +0300
commitfa0e380e627644f269cfbd0ed4cf79f15ff74176 (patch)
treec231d9801bef7830ec5600a4a538771d34960562 /src/input/encode.rs
parentf33e1a0faae5e0ecbfd9653f9635d83793c98b95 (diff)
fix: preserve alt backspace in panes (#165)
refs #155 Co-authored-by: kangal-bot <kangal-bot@users.noreply.github.com>
Diffstat (limited to 'src/input/encode.rs')
-rw-r--r--src/input/encode.rs15
1 files changed, 15 insertions, 0 deletions
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
@@ -524,6 +524,12 @@ mod tests {
}
#[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");
assert_eq!(encode_cursor_key(KeyCode::Down, true), b"\x1bOB");
@@ -639,6 +645,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);
assert_eq!(