[BUG] Ctrl+C and Ctrl+Shift+C silently clear prompt input with no confirmation or recovery
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When the prompt input buffer is non-empty, pressing either Ctrl+C or Ctrl+Shift+C silently discards the entire buffer. There is no confirmation, no echo to scrollback, no warning, and no way to recover what was typed. A single accidental keypress destroys arbitrarily large amounts of carefully composed work.
Both keystrokes are strong muscle-memory copy shortcuts:
Ctrl+Cis the universal copy shortcut in GUI applications.Ctrl+Shift+Cis the standard copy shortcut in many terminals (gnome-terminal, Konsole, Windows Terminal) and is also the browser devtools "select an element" shortcut.
Users reach for one or the other reflexively, expecting a copy - or mistake which window has focus - and lose their work instead.
What Should Happen?
A non-empty input buffer must never be cleared without confirmation. Acceptable forms of confirmation:
- An inline prompt ("Discard N lines? y/N"), or
- A repeat-press confirmation: a single press shows a warning hint, only a second press within a short window commits the clear.
After the clear, the action must be undoable via Ctrl+Z, and an onscreen hint at the moment of clearing must say so (e.g. "Input cleared — press Ctrl+Z to restore"). Without the hint the undo is undiscoverable.
The two requirements pair: confirmation prevents accidents the user notices in time; undo plus hint catches the ones that slip through.
Error Messages/Logs
None. The clear is silent — no error, no warning, no echo of the discarded content.
Steps to Reproduce
- Open Claude Code in any standard terminal.
- Type several lines into the prompt — enough that retyping would be costly.
- With no text selected, press
Ctrl+C. (Alternatively,Ctrl+Shift+C.) - Observe: the input buffer is cleared. Typed content is gone. No confirmation, no echo, no recovery.
Reproduced in Windows Terminal, cmder, and the integrated terminal of a JetBrains IDE.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.142 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
Related existing issues (different destructive targets, same class of bug — destructive keybinding with no confirmation):
- #55590
- #52377
19 Comments
I face the same problem on Mac OS as well. I spend 15 minutes writing a long prompt, and when I'm doing Control+V to paste an image accidentally, I hit Ctrl+C and the entire thing goes away.
This is one of the most painful keyboard problems that I face. This is one of the most painful keyboard problems that I face. If Possible I should be able to at least disable Ctrl+C for this behavior.
seeing similar issues
It's also frustrating that any active tool calls are stopped when attempting to clear the prompt. These should really have separate key bindings.
I was sure it's a glitch, but after hitting it for the 10th time I decided to search for the culprit.
Please make it stay in history, so arrow up brings the input back, really frustrating to lose the long prompt you've been writing for past 10 minutes or so.
Same problem on Linux, this is not a
platform:windowsbug. Please update labels, I lost a LOT of work because of this. This shouldn't be that hardMonths later and Anthropic hasn't bothered to even acknowledge this issue or put it in their backlog. It's mind-blowing how an accidental keystroke can completely wipe out an entire prompt without any safety net or warning.
Configuration I'm using while the issue is open (Ctrl+_ and Ctrl+Shift+- are captured by the terminal)
(And of course there's no redo)
This is the single biggest annoyance that really gets in the way of working flow with CC. At this point I have to use CC with an open editor for building prompts. CTRL-C is so hard wired at this point for in-app copying and in-bash SIGINT that having it do something different in CC feels like a real bug or just terrible TUI design oversight.
Lost an hour of thinking and writing, because I hit Ctrl C instead of Ctrl V 😢
This really hurts!! What an anti-feature!
I know right. On Ctrl+U it shows Ctrl+Y as undo. A easy fix is to just allowing Ctrl+Y here as well. but current the input is just gone. all the thinking and writing is just lost.
Honestly as the prompt starts getting long I start getting nervous about accidentally hitting Ctrl + C and losing it. so I have resorted to writing the prompt on the side in a file and just pasting it when I'm ready to send it
+1 to this issue. I routinely use ctrl+c to clear out text and it works in the CLI anywhere else, and it even works in Claude Code - except it also causes this horrible side effect. If the main agent is working it'll cancel their work and even worse if a subagent is working it'll cancel the subagent and I'll lose everything they were doing.
ctrl+c should only clear text, it should not also cancel work in progress. esc already does that so there's no need to have ctrl+c do it too. I don't agree with OP's suggestion of how to address this, but the other dozens of issues related to this problem were all closed as duplicate or as not planned.
Having the same problem, maybe I need a configuration to disable the "Ctrl + C" key binding because I don't need it at all.
+1 PLEASE add hotkey to clear TUI input WITHOUT stopping the turn!
Just another day losing my data. After I thought I pressed Ctrl+V my immediate thought was, maybe Ctrl+Shift+V would've been better, because it often pastes as "20 pasted lines" or similar, and I have to past again to see what I pasted. Before I did so, I noticed that not only did not paste, the input turned blank. That's when I looked where my fingers were. My immediate reaction was Ctrl+Z (undo attempt) but that crashes CC (probably another existing bug but too lazy to look for it) so I couldn't even use the _actual_ undo (Ctrl+Shift+_)
Confirming this affects me too, and it's a significant productivity hit. My case: I use Ctrl+Shift+C intentionally to copy selected text out of the terminal (since Ctrl+C alone is the interrupt signal in most terminal emulators). But when nothing is selected and I hit Ctrl+Shift+C inside Claude Code's prompt by habit, it silently wipes the entire input buffer — no confirmation, no way to recover it.
This has cost me 10-15+ minutes of typed prompt content on multiple occasions, since I often draft long, detailed prompts directly in the CLI rather than pasting them in.
Given Ctrl+Shift+C is a near-universal "copy" binding in terminal emulators (Windows Terminal, GNOME Terminal, etc.), treating it as a destructive clear action with zero recovery is a real footgun. Even a simple safety net — like the undo mechanism proposed in the linked opencode PR (Cmd+Z / Ctrl+- to restore the last cleared input) — would fix this without changing the existing clear behavior for anyone who relies on it.
+1 from me — would love to see this prioritized.
@mdmfox Undo is already implemented as Ctrl+Shift+_. I don't know why it would be 'proposed' elsewhere.
I tested if maybe undo wouldn't work in your case, but I can't even reproduce it. Only Ctrl+C clears it for me, not Ctrl+Shift+C (=does nothing). What terminal emulator are you using? (I'm on gnome-terminal)
You have saved my day and I wish I knew about this hotkey sooner. I have run into this problem multiple times. I do agree with several other posters that this is a challenging issue given the typical terminal operation for ctrl+C does not work well when trying to type up long prompts.
@MarkJeronimus Thanks for pointing out the solution with Ctrl+Shift+_ . I tested it on my end and it worked!
It does revert my prompt in both cases: