^C throws away the buffer
What happened?
Frustratingly often, i've typed ^C (perhaps as a reflex after a typo) and lost the whole message I was drafting. I would like if the draft was stored somewhere, perhaps at the [-1] position, so I can hit the up key to undo it.
What did you expect to happen?
I can undo an accidental ^C, perhaps with the up key.
Client information
- CLI Version: 0.21.0
- Git Commit: 1f1bbc462
- Session ID: 27fa8af1-eb75-48f7-b867-4e88f8d1d9cf
- Operating System: darwin v25.0.0
- Sandbox Environment: no sandbox
- Model Version: gemini-3-pro-preview
- Memory Usage: 340.5 MB
Login information
No response
Anything else we need to know?
No response
Found the input handling in packages/cli/src/ui/components/InputPrompt.tsx. Ctrl+C maps to Command.CLEAR_INPUT which clears the buffer.
The history mechanism uses useCommandHistory hook but only saves submitted prompts, not cancelled drafts. Adding the current buffer to a temporary 'draft' slot before clearing would enable recovery via up-arrow.
Just now, I asked it to write some notes in TODO. I got the suggested amendment with the 4 options. I hit escape (I think option 4) to give more context. While I was typing, I noticed the model was still working:
✦ The write operation to TODO.md was cancelled. I will ensure I append the new section to the existing content instead of
overwriting it. First, I'll read the current TODO.md…
I hit escape again to stop it, and also lost what I was typing.