Skip to content

Fix native Windows Codex cursor flicker - #4907

Merged
Jinwoo-H merged 3 commits into
mainfrom
Jinwoo-H/codex-tui-cursor-flicker-repro
Jun 9, 2026
Merged

Jinwoo-H merged 3 commits into
mainfrom
Jinwoo-H/codex-tui-cursor-flicker-repro

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Reorder unsafe native Windows synchronized cursor restore bytes so Codex cannot briefly paint the cursor at the old Working row before moving it to the input row.
  • Keep the protection scoped to the existing native Windows synchronized-output path; this does not add global cursor hiding.
  • Add a scheduler regression test for the final-placement-before-synchronized-end frame shape.

Root Cause

Codex can emit a synchronized redraw that shows the cursor before the same frame places it at the final input location. On native Windows ConPTY, Orca could pass that intermediate state through to xterm, and Chromium could rasterize the cursor in the old Working row for a frame. The fix rewrites only that unsafe sequence to place the cursor first, then show it.

Validation

  • npx vitest run --config config/vitest.config.ts src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler.test.ts
  • npx oxlint src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler.ts src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler.test.ts
  • npx playwright test tests/e2e/terminal-codex-cursor-jitter-repro.spec.ts --config tests/playwright.config.ts --project electron-headful --workers=1

Real Codex TUI raster repro on native Windows: before the fix it captured 3 Working-row cursor frames; after the fix it captured 151 frames with 0 Working-row cursor frames.

@Jinwoo-H
Jinwoo-H force-pushed the Jinwoo-H/codex-tui-cursor-flicker-repro branch from c8ffeeb to a427446 Compare June 9, 2026 00:45
@Jinwoo-H
Jinwoo-H merged commit 57c1e21 into main Jun 9, 2026
4 checks passed
@Jinwoo-H
Jinwoo-H deleted the Jinwoo-H/codex-tui-cursor-flicker-repro branch June 9, 2026 01:11
LesleyMurfin added a commit to LesleyMurfin/orca that referenced this pull request Jun 25, 2026
…PTYs

The cursor hide/show protection added for native-Windows ConPTY (stablyai#4669/stablyai#4907)
is gated to isNativeWindowsConpty and is never applied to remote-runtime PTYs.
Remote serve-hosted PTYs split the \e[?25l ... \e[?25h burst across separate
output frames identically, leaving the text cursor hidden while typing in
repainting TUIs (claude, vim, htop) over the serve->client transport.

- Extract the protection gate into a pure shouldProtectSplitCursorBursts()
  predicate and broaden it to remote-runtime PTYs (native-Windows ConPTY
  behaviour unchanged).
- Add a persistent hold-until-show so an intermediate cursor-free redraw
  frame extends the hold instead of draining cursor-hidden (>=3-frame split).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant