[FEATURE] Ctrl+C destroys the draft prompt with no recovery - preserve cleared input in history like double-Esc does

Status Fixed / completed
Reported on v2.1.218
Maintainer reply None cached
Activity 2 comments · opened Jul 23, 2026 · closed Aug 17, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

A single Ctrl+C press clears the entire prompt input with no way to recover it. Per the docs (interactive-mode), double-Esc clears the input but saves the draft to history so Up recalls it, while Ctrl+C just discards it. Nothing is written to ~/.claude/history.jsonl, no draft file exists on disk, and Up arrow only recalls submitted prompts.

This is especially punishing on macOS because image pasting requires Ctrl+V (Cmd+V cannot attach images, see #33577). C sits directly next to V, so while composing a long prompt with screenshots it is very easy to slip and hit Ctrl+C instead of Ctrl+V. One mistyped key instantly destroys the whole draft. Today I lost a prompt I had spent ~10 minutes writing, with multiple pasted images, exactly this way.

Related prior issues: #15161 (closed) asked for exit confirmation on repeated Ctrl+C but did not cover the destructive single-press clear; #36142 (closed) reported input disappearing on an accidental key combo.

Proposed Solution

Make Ctrl+C-cleared input recoverable, in whichever form is cheapest:

  • Push the cleared text into prompt history, exactly like double-Esc already does, so Up arrow restores it, or
  • Put the cleared text into the Ctrl+S stash slot so Ctrl+S on an empty prompt restores it (including pasted image attachments), or
  • Keep the current behavior but add an input-editor undo entry so Ctrl+_ after the clear restores the draft.

Any of these turns a one-keystroke data loss into a recoverable slip. The double-Esc code path proves the mechanism already exists; Ctrl+C just doesn't use it.

Environment

  • Claude Code 2.1.218
  • macOS 26.5.2 (Ghostty terminal)

View original on GitHub ↗

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