Esc immediately after Return silently loses the just-submitted message (unrecoverable)
Summary
Pressing Esc immediately after submitting a prompt with Return discards the just-sent message. It never lands in input history, so Up-arrow can't recall it and Esc-Esc rewind has nothing to restore. The typed text is silently lost.
Repro
- Type a message.
- Press Return to submit.
- Immediately press Esc (e.g. reflexively, to correct a typo you just noticed) while the turn is starting / the response is in-flight.
- The message is gone: Up-arrow does not bring it back, and Esc-Esc rewind does not list it.
Expected
An interrupted-immediately submission should be preserved - either committed to input history (recallable via Up) or restored to the composer - so the text isn't lost.
Impact
Silent loss of user-typed input, easy to trigger by muscle memory (Esc to fix a typo right after sending). Can lose a long message with no recovery.
Likely cause (speculative)
A race between Return committing the message to input history and Esc cancelling the in-flight turn before that commit.
Environment
- Claude Code 2.1.162
- Linux
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗