[BUG] Copy a prompt with Ctrl+C before submitting the prompt will cause you to lose the prompt
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?
Conversation with Claude about my issue:
ME: I just wrote a really long prompt here and then I tried to highlight it and copy it and when I hit control C it disappeared. can I get it back
CLAUDE: I understand how frustrating that is! Unfortunately, I don't have access to your clipboard history or the text you were typing in the terminal. The Ctrl+C command sends a SIGINT signal that terminates the current process, which likely cleared your input.
Here are a few options to try to recover it:
- Check your clipboard manager (if you have one installed):
- Windows: You can try Windows+V to access clipboard history if it's enabled
- Some third-party clipboard managers might have captured it
- Enable clipboard history on Windows (for future protection):
- Go to Settings → System → Clipboard
- Turn on "Clipboard history"
- Then you can use Windows+V to access previous clipboard items
- Terminal/Shell history: If you had previously submitted similar commands or text in this terminal session, you might be able to access it through your shell history, but this typically doesn't capture unsent input.
Unfortunately, if the text was only typed but never submitted or copied successfully, it's likely lost. For future protection when writing long prompts, I'd recommend:
- Composing in a text editor first
- Enabling clipboard history on Windows
- Using Ctrl+A to select all before copying (to ensure selection)
I'm sorry I couldn't recover it for you. Would you like to recreate your prompt? I'm here to help with whatever you were trying to ask.
ME: that sucks. so in the future how can I copy a prompt out before submitting it?
● To copy your prompt before submitting it in Claude Code:
- Select the text: Use Shift+Arrow keys or Shift+Home/End to highlight your text
- Shift+Home: Select from cursor to start of line
- Shift+End: Select from cursor to end of line
- Ctrl+A: Select all text in the input field
- Copy it: Once highlighted, press Ctrl+C to copy
- Important: Make sure you see the text actually highlighted (usually shown with a different background color) before pressing Ctrl+C
The key is selecting first with Shift+Arrow keys or Ctrl+A, then copying. If you just press Ctrl+C without selection, it sends the interrupt signal instead.
Pro tip: For long prompts, consider writing them in a text editor (like Notepad, VS Code, etc.) first, then paste them into Claude Code using Ctrl+V. This way you always have a backup of your prompt.
ME: that is not true Ctrl+A does not selected text either. please submit this has feedback to your development team
● You're absolutely right, and I apologize for the incorrect information. I don't have the ability to submit feedback directly to the development team, but you can report this issue at:
https://github.com/anthropics/claude-code/issues
When you report it, I'd suggest mentioning:
- Ctrl+A doesn't select text in the input field
- Ctrl+C without selection clears the input instead of copying
- Request for better text selection/copying support for long prompts
- Suggestion: Maybe a way to prevent accidental clearing of unsent input
This is clearly a usability issue that affects composing longer prompts, and reporting it on GitHub will get it to the right team. Thank you for bringing this to my attention!
What Should Happen?
Highlighting in the prompt box and hitting Ctrl+C should allow you to copy your prompt.
Error Messages/Logs
Steps to Reproduce
- Visual Studio 2022 with Claude Code
- Enter anything into the prompt.
- Before hitting "enter" key to submit the prompt highlight the text with your mouse.
- Click Ctrl+C to copy the highlighted text
- The text is lost and not copied to your clipboard.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.14
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗