mirror of
https://github.com/openai/codex.git
synced 2026-11-22 23:00:42 +00:00
## Why Rewinding to edit an earlier prompt restores it in the composer. If a second rewind gesture is already buffered, its Enter can submit the restored prompt before the user edits it. [Prompt rewind behavior](https://github.com/openai/codex/pull/45845) ## What changed Pause terminal input as soon as a rewind is queued. Drain buffered input before showing the restored prompt, and use the same drain after forks from a locked thread or the agents overview. Retry in bounded batches while input is still pending, deliver buffered focus changes in order, and recheck terminal size when the drain finishes. ## Testing Extend PTY coverage to verify that repeated rewind keystrokes and a trailing Escape leave the restored prompt ready for a fresh edit and submission. Cover delayed paste completion, focus event ordering, and terminal resize during a drain. GitOrigin-RevId: 65ba4f343892ed3ba2eeb120172f66bfbebe120f