Esc immediately after Return silently loses the just-submitted message (unrecoverable)

Resolved 💬 2 comments Opened Jun 4, 2026 by willert Closed Jun 8, 2026

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

  1. Type a message.
  2. Press Return to submit.
  3. Immediately press Esc (e.g. reflexively, to correct a typo you just noticed) while the turn is starting / the response is in-flight.
  4. 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

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗