mirror of
https://github.com/openai/codex.git
synced 2026-12-03 00:41:03 +00:00
## Why A terminal's startup color reply can arrive in pieces across the handoff from the startup probe to the live input reader. If the reader treats the leading Escape as a key, the rest of the reply can leak into the composer or trigger a shortcut. A standalone Escape still needs to dismiss reverse history search and leave subsequent typing intact. ## What changed Pass the outstanding foreground and background color queries to Crossterm along with replayed input and the remainder of a two-second reply window measured from the query. Track each completed reply, including valid replies consumed inside bracketed paste. Update the Crossterm pin and let the input drain at screen transitions wait for an ambiguous Escape to resolve within that window. ## Testing Add parser and PTY regression tests for replies completed during probing, split across the handoff, or started in the live reader. Cover bracketed paste, idle Escape followed by typing, and the distinction between a reply's BEL terminator and the editor shortcut. Run the timing-sensitive PTY cases serially in a dedicated Linux Bazel target. GitOrigin-RevId: b7d7db6f7d57866aad18e5bc99c32773ad25f95c