diff --git a/codex-rs/tui/src/app/platform_actions.rs b/codex-rs/tui/src/app/platform_actions.rs index 415318a3e..f19ed0bb6 100644 --- a/codex-rs/tui/src/app/platform_actions.rs +++ b/codex-rs/tui/src/app/platform_actions.rs @@ -65,7 +65,11 @@ pub(super) fn side_return_shortcut_matches(key_event: KeyEvent) -> bool { modifiers, kind: KeyEventKind::Press, .. - } if modifiers.contains(KeyModifiers::CONTROL) && c.eq_ignore_ascii_case(&'c') => true, + } if modifiers.contains(KeyModifiers::CONTROL) + && (c.eq_ignore_ascii_case(&'c') || c.eq_ignore_ascii_case(&'d')) => + { + true + } _ => false, } } @@ -75,7 +79,7 @@ mod tests { use super::*; #[test] - fn side_return_shortcuts_match_esc_and_ctrl_c() { + fn side_return_shortcuts_match_esc_ctrl_c_and_ctrl_d() { assert!(side_return_shortcut_matches(KeyEvent::new( KeyCode::Esc, KeyModifiers::NONE, @@ -93,10 +97,14 @@ mod tests { KeyCode::Char('C'), KeyModifiers::CONTROL, ))); - assert!(!side_return_shortcut_matches(KeyEvent::new( + assert!(side_return_shortcut_matches(KeyEvent::new( KeyCode::Char('d'), KeyModifiers::CONTROL, ))); + assert!(side_return_shortcut_matches(KeyEvent::new( + KeyCode::Char('D'), + KeyModifiers::CONTROL, + ))); assert!(!side_return_shortcut_matches(KeyEvent::new_with_kind( KeyCode::Esc, KeyModifiers::NONE,