[BUG] Sent message lost from history and display when pressing esc + up arrow
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?
I sometimes write a prompt and send it, realize I have one detail wrong, press esc instead of esc twice. If after the esc I press up, I see the prior message, the pending prompt message is gone, and pressing down back shows nothing. (if I press esc->down, the message is intact).
I don't do this on purpose, but it's definitely annoying when I have a long prompt and it disappears.
Note that this doesn't happen if the prompt is the first one in a session, since "up" probably needs to navigate to something in the history.
What Should Happen?
The aborted message should appear after pressing up. Alternatively, the aborted message should appear when pressing down after esc->up.
Error Messages/Logs
Steps to Reproduce
- Send a prompt to claude, wait for it to finish.
- Send another prompt
- While it's thinking, press esc once, press up.
- The first prompt will appear, and the second prompt is now gone
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.167 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗