No action clears the prompt buffer without a side effect; chat:clearInput is a redraw that arms /clear

Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 0 comments · opened Aug 3, 2026

Problem

There is no single keystroke that clears a multi-line prompt buffer without a side effect. Every existing option fails in one of two ways: it does not clear the whole buffer, or it does something destructive on top of clearing.

Incomplete: clears only part of the buffer.

| Key | Behavior | Why it falls short |
| --- | --- | --- |
| ctrl+u | deleteToLineStart | One line per press. A twenty line draft takes twenty presses. |
| ctrl+k | deleteToLineEnd | Same, and only forward from the cursor. |
| ctrl+w | deleteWordBefore | One word per press. |

These are the safe ones. They are pure text edits, they cannot touch the agent, and ctrl+y yanks the text back. They just do not scale past a couple of lines.

Destructive: clears everything, plus something you did not ask for.

| Action | Default | What else it does |
| --- | --- | --- |
| chat:cancel | escape | Interrupts the running turn. Safe only when idle, which is exactly when you least need it. |
| app:interrupt | ctrl+c | Interrupts the running turn. Hardcoded, cannot be rebound. |
| chat:stash | ctrl+s | Not destructive, but not a clear either: the draft is saved and comes back after the next prompt. |
| chat:clearInput | ctrl+l | Does not clear the input at all, and a double tap discards the entire conversation (see below). |
| chat:clearScreen | cmd+k | Same double tap path to /clear. |

The one option that is both complete and non-destructive is chat:externalEditor (ctrl+g): open the buffer in $EDITOR, empty it, save, quit. It works mid-run without interrupting anything, which shows the capability is not inherently unsafe. It is just a round trip through another program to delete some text.

Rebinding cannot fix this, because the gap is in the action set, not the key map. The full Chat action list is cancel, killAgents, cycleMode, modelPicker, fastMode, thinkingToggle, workflowKeywordToggle, submit, newline, undo, externalEditor, stash, imagePaste, clearInput, clearScreen. None of them empties the buffer and stops there.

chat:clearInput is misnamed, and worse than misnamed

In 2.1.220 the handler is a screen redraw that also arms a two second double-press gate whose second press submits /clear:

[tQ, tW] = useState(0)
useLayoutEffect(() => { if (tQ === 0) return; stdout.forceRedraw() }, [tQ])

Uge = () => { Ft.current?.("/clear", true) }        // second press
_7  = Lee(MLe, Uge, undefined, 2000)                // 2s double-press window
One = () => { tW(n => n + 1); OR.current = DR; _7() }   // chat:clearInput
aH  = () => { OR.current = jF; _7() }                   // chat:clearScreen

So an action named clearInput preserves the input and, on a double tap, discards the entire conversation. Anyone who reads the action list in the keybindings docs and binds chat:clearInput expecting it to clear the input gets a session wipe instead. Binding it to a chord makes an accidental double tap easier, not harder.

Request

  1. A chat:clearInputText action (name negotiable) that empties the prompt buffer and does nothing else: no interrupt, no stash, no /clear, no redraw.
  2. Rename chat:clearInput to match what it does, which also frees the name for item 1.

Previously requested in #68851 (closed as not planned by the inactivity bot, which invited a new issue) and #52377.

Environment

Claude Code 2.1.220, macOS 26.6.0, Homebrew cask claude-code@latest.

🤖 Generated with Claude Code

View original on GitHub ↗