Problem
When composing a long multi-line prompt in the TUI, there's no quick way to clear the entire input buffer at once. Currently, users must repeatedly use Ctrl+U (kill to beginning of line) or Ctrl+K (kill to end of line) multiple times to clear a multi-line prompt, which is tedious.
This is a common workflow when:
- You've drafted a long prompt but want to start fresh
- You've pasted content that you want to discard entirely
- You want to quickly switch context without submitting
Proposed solution
Add a keyboard shortcut to clear the entire input buffer in one action. Suggested bindings (pick one or make configurable):
| Platform |
Shortcut |
Rationale |
| All |
Ctrl+Shift+U |
Extends existing Ctrl+U (kill line) to "kill all" |
| All |
Alt+U |
Consistent with Emacs-style bindings already used |
| macOS |
Cmd+Backspace |
Standard macOS "delete to beginning" |
The killed text should be added to the kill buffer so Ctrl+Y can restore it if needed (consistent with existing kill/yank behavior).
Alternatives considered
- Repeatedly pressing
Ctrl+U – Current workaround, tedious for multi-line input
- Using
/new – Clears input but also resets the entire conversation (too destructive)
Esc to exit and re-enter – Doesn't clear the buffer, text persists
Implementation notes
The textarea.rs already has kill_to_beginning_of_line() and kill_to_end_of_line(). A new method like kill_all() could:
- Set cursor to end of buffer
- Kill from cursor to position 0
- Add entire content to kill buffer
Reference: codex-rs/tui/src/bottom_pane/textarea.rs
Priority
Low (quality-of-life improvement)
Category
Interactive mode (TUI)
Problem
When composing a long multi-line prompt in the TUI, there's no quick way to clear the entire input buffer at once. Currently, users must repeatedly use
Ctrl+U(kill to beginning of line) orCtrl+K(kill to end of line) multiple times to clear a multi-line prompt, which is tedious.This is a common workflow when:
Proposed solution
Add a keyboard shortcut to clear the entire input buffer in one action. Suggested bindings (pick one or make configurable):
Ctrl+Shift+UCtrl+U(kill line) to "kill all"Alt+UCmd+BackspaceThe killed text should be added to the kill buffer so
Ctrl+Ycan restore it if needed (consistent with existing kill/yank behavior).Alternatives considered
Ctrl+U– Current workaround, tedious for multi-line input/new– Clears input but also resets the entire conversation (too destructive)Escto exit and re-enter – Doesn't clear the buffer, text persistsImplementation notes
The
textarea.rsalready haskill_to_beginning_of_line()andkill_to_end_of_line(). A new method likekill_all()could:Reference:
codex-rs/tui/src/bottom_pane/textarea.rsPriority
Low (quality-of-life improvement)
Category
Interactive mode (TUI)