[FEATURE] Add keyboard shortcut to clear entire multi-line input buffer

Resolved 💬 3 comments Opened Feb 3, 2026 by jakvbs Closed Feb 3, 2026

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

  1. Repeatedly pressing Ctrl+U – Current workaround, tedious for multi-line input
  2. Using /new – Clears input but also resets the entire conversation (too destructive)
  3. 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:

  1. Set cursor to end of buffer
  2. Kill from cursor to position 0
  3. 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)

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗