the runtime your coding agents live on
Rust agentagent-orchestrationaiai-agentsclaude-codeclicodexcoding-agentsdeveloper-toolsdevtoolsmultiplexerrustterminalterminal-multiplexerterminal-uitmuxtuiworkspace-manager
fix input encoding for ctrl+letter in kitty mode
Ogulcan Celik305d95770432
diff --git a/src/input/encode.rs b/src/input/encode.rsindex 1311d4a02..6599b3bac 100644--- a/src/input/encode.rs+++ b/src/input/encode.rs@@ -151,15 +151,6 @@ fn try_encode_csi_u(key: &TerminalKey, flags: u16) -> Option<Vec<u8>> {return None;}- // Plain Ctrl+letter is well-represented in legacy (bytes 1-26)- if mods == KeyModifiers::CONTROL {- if let KeyCode::Char(c) = key.code {- if c.is_ascii_alphabetic() {- return None; // let legacy handle it- }- }- }-// Special keys (arrows, F-keys, etc.) have well-established legacy// xterm modified formats (\x1b[1;3A for Alt+Up, etc.) that are universally// understood. Even Ghostty sends these in legacy format with kitty mode on.diff --git a/src/input/tests.rs b/src/input/tests.rsindex d624d28aa..6e196ad71 100644--- a/src/input/tests.rs+++ b/src/input/tests.rs@@ -295,12 +295,20 @@ fn kitty_alt_enter() {}#[test]-fn kitty_plain_ctrl_c_uses_legacy() {- // Plain Ctrl+letter is well-represented in legacy+fn kitty_plain_ctrl_c_uses_csi_u() {let key = KeyEvent::new(KeyCode::Char('c'), KeyModifiers::CONTROL);assert_eq!(encode_key(key, KeyboardProtocol::Kitty { flags: 1 }),- vec![3]+ b"\x1b[99;5u"+ );+}++#[test]+fn kitty_plain_ctrl_c_includes_press_event_when_requested() {+ let key = KeyEvent::new(KeyCode::Char('c'), KeyModifiers::CONTROL);+ assert_eq!(+ encode_key(key, KeyboardProtocol::Kitty { flags: 3 }),+ b"\x1b[99;5:1u");}