mirror of
https://github.com/openai/codex.git
synced 2026-11-23 23:10:47 +00:00
## Why Commands often update progress in place using carriage returns and ANSI erase-line sequences. Treating those writes as ordinary text can leave stale progress visible, and treating each streamed chunk as a line can split a single update in `/ps`. ## What changed Resolve redraws into the visible row before laying out live and completed command output or rendering transcript entries. Preserve the unwritten suffix on a shorter overwrite, honor line erases, and retain ANSI styling for the text that survives. Buffer partial rows across output chunks so `/ps` shows the latest visible lines as plain text. ## Testing Cover split escape sequences and CRLF, styled and wide-character overwrites, and redraws after the live output byte limit. Check that live and completed previews agree and that replayed background terminals and historical command fallbacks show the resolved text. GitOrigin-RevId: cabb3d33442fbf119e23a12b2c66cb62d88bd06c