Skip to content

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

@jakvbs

Description

@jakvbs

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions