From f8c4d6a5f1bd4bcaee43ba3e1373465cd960cdc3 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Sat, 28 Mar 2026 00:32:35 +0300 Subject: feat: add per-agent sound overrides --- src/input.rs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/input.rs') diff --git a/src/input.rs b/src/input.rs index dbbf65df..f7c1f5c2 100644 --- a/src/input.rs +++ b/src/input.rs @@ -36,9 +36,17 @@ fn try_encode_csi_u(key: &KeyEvent) -> Option> { // understood. Even Ghostty sends these in legacy format with kitty mode on. // Only use CSI u for character keys and keys without legacy representations. match key.code { - KeyCode::Up | KeyCode::Down | KeyCode::Left | KeyCode::Right - | KeyCode::Home | KeyCode::End | KeyCode::PageUp | KeyCode::PageDown - | KeyCode::Insert | KeyCode::Delete | KeyCode::F(_) => { + KeyCode::Up + | KeyCode::Down + | KeyCode::Left + | KeyCode::Right + | KeyCode::Home + | KeyCode::End + | KeyCode::PageUp + | KeyCode::PageDown + | KeyCode::Insert + | KeyCode::Delete + | KeyCode::F(_) => { return None; // let legacy handle these } _ => {} @@ -262,10 +270,7 @@ mod tests { #[test] fn legacy_ctrl_shift_end() { - let key = KeyEvent::new( - KeyCode::End, - KeyModifiers::CONTROL | KeyModifiers::SHIFT, - ); + let key = KeyEvent::new(KeyCode::End, KeyModifiers::CONTROL | KeyModifiers::SHIFT); assert_eq!(encode_key(key, false), b"\x1b[1;6F"); } @@ -330,10 +335,7 @@ mod tests { #[test] fn kitty_ctrl_shift_enter() { - let key = KeyEvent::new( - KeyCode::Enter, - KeyModifiers::CONTROL | KeyModifiers::SHIFT, - ); + let key = KeyEvent::new(KeyCode::Enter, KeyModifiers::CONTROL | KeyModifiers::SHIFT); assert_eq!(encode_key(key, true), b"\x1b[13;6u"); } } -- cgit v1.2.3