Skip to content

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

Closed

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)

Activity

  1. added
    enhancement
    CLI
    TUI
    on Feb 3, 2026
  2. jakvbs commented on Feb 3, 2026

    @jakvbs
    Author

    Related: #3049 (Configurable Hotkeys Support) - if configurable keybindings are implemented, this shortcut could be part of that system. However, this issue can be addressed independently as a sensible default binding.

  3. etraut-openai commented on Feb 3, 2026

    @etraut-openai
    Contributor

    Does Ctrl+C work for you?

  4. jakvbs commented on Feb 3, 2026

    @jakvbs
    Author

    Does Ctrl+C work for you?

    It does, thanks for help. Closing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLITUIenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions