-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Description
What version of Codex is running?
codex-cli 0.46.0
Which model were you using?
gpt-5-codex high
What platform is your computer?
Darwin 25.1.0 arm64 arm
What steps can reproduce the bug?
When a draft or attachment is present, pressing Esc
shows a footer hint that says you can edit the previous message, but pressing Esc
again does nothing. The UI advertises a shortcut that never actually works unless the composer is empty.
Description
When the composer contains text or attachments and Esc
is pressed, the footer changes from
[xx]% context left · ? for shortcuts
to
esc esc to edit previous message
Pressing Esc
a second time does nothing.
When the composer is empty and Esc
is pressed, the footer instead shows
esc again to edit previous message
and the second Esc
correctly opens the backtrack navigator.
The issue has two parts: the shortcut doesn’t work when a draft is present, and the hint is misleading because it repeats “esc esc” even though Esc
has already been pressed once, when it should probably say "esc again" like the non-empty message already does.
What is the expected behavior?
Cause
In App::handle_backtrack_esc_key
, backtrack only runs when the composer is empty:
// Only handle backtracking when composer is empty to avoid clobbering edits.
if self.chat_widget.composer_is_empty() { ... }
That check was originally added to prevent users from accidentally losing a draft, since confirming a backtrack replaces whatever is in the composer with an older message. Requiring the composer to be empty made that impossible.
I think backtrack should work even when the composer is not empty, especially since backtrack already requires two Esc
presses to confirm. Drafts could remain untouched until confirmation.
Even if the current restriction is kept, the footer text would still be wrong, since it tells users they can edit a previous message when they actually cannot unless the composer is cleared.
Paths forward
- Update the footer so the edit message hint “esc esc to edit previous message” only appears when the composer is empty. It should also probably be changed to “esc again to edit previous message” to reflect the actual behavior and align with the non-empty message.
- Allow backtrack to prime even when the composer isn’t empty, keeping drafts intact until the user explicitly confirms to edit another message.
What do you see instead?
No response
Additional information
No response