MoonshotAI / MoonshotAI/kimi-code
Ctrl+C silently destroys unsent multi-line drafts with no recovery path
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
Ctrl+C silently destroys unsent multi-line drafts with no recovery path
Environment
- kimi-code CLI 0.42.0 (npm install), Windows 11, Windows Terminal
- This has happened to me multiple times across recent versions; today it destroyed a two-hour feature plan
What happened
A long multi-line draft was in the input box. Ctrl+C was pressed — a reflex, it is the most common key combination there is. The input box cleared instantly, before the text was ever sent. The draft was unrecoverable.
Why there is no recovery (all verified on disk)
- The undo selector (Esc Esc) only lists sent prompts — it is conversation undo, not input undo
- Input history (up/down) only recalls sent messages; a Ctrl+C-cleared draft never enters it
- Nothing is persisted for unsent input:
user-history/*.jsonl, sessionstate.json, and the CLI logs contain only sent content and metadata - Since the draft was never submitted, it never reached the API or any cache
The docs describe the shortcut as "clear the input box" — the behavior matches the docs, but the outcome is destructive data loss from a single common keystroke, with no confirmation and no undo.
Suggestions (any one of these would prevent the damage)
- Persist drafts (e.g., into the session directory) and restore them on resume
- Push the cleared input into the input history so it can be recalled with the up arrow
- Require a second Ctrl+C confirmation when the input box is non-empty — the same double-press pattern already used for exiting
Option 3 is the smallest change and mirrors existing behavior.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the CLI input handling for Ctrl+C and the existing double-press exit behavior described in the issue. Trace how non-empty drafts are cleared, then verify the chosen recovery or confirmation behavior with an appropriate CLI test; done means a Ctrl+C cannot silently destroy an unsent multi-line draft.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100