diff --git a/codex-rs/tui/src/bottom_pane/textarea.rs b/codex-rs/tui/src/bottom_pane/textarea.rs index 2caa45602..a32b584c2 100644 --- a/codex-rs/tui/src/bottom_pane/textarea.rs +++ b/codex-rs/tui/src/bottom_pane/textarea.rs @@ -322,7 +322,12 @@ impl TextArea { code: KeyCode::Delete, modifiers: KeyModifiers::ALT, .. - } => self.delete_forward_word(), + } + | KeyEvent { + code: KeyCode::Char('d'), + modifiers: KeyModifiers::ALT, + .. + } => self.delete_forward_word(), KeyEvent { code: KeyCode::Delete, .. @@ -1763,6 +1768,15 @@ mod tests { assert_eq!(t.cursor(), 0); } + #[test] + fn delete_forward_word_alt_d() { + let mut t = ta_with("hello world"); + t.set_cursor(6); + t.input(KeyEvent::new(KeyCode::Char('d'), KeyModifiers::ALT)); + pretty_assertions::assert_eq!(t.text(), "hello "); + pretty_assertions::assert_eq!(t.cursor(), 6); + } + #[test] fn control_h_backspace() { // Test Ctrl+H as backspace