Skip to content

Fix native Windows synchronized cursor placement#4753

Open
Jinwoo-H wants to merge 1 commit into
mainfrom
Jinwoo-H/native-windows-cursor-flicker-root-cause
Open

Fix native Windows synchronized cursor placement#4753
Jinwoo-H wants to merge 1 commit into
mainfrom
Jinwoo-H/native-windows-cursor-flicker-root-cause

Conversation

@Jinwoo-H
Copy link
Copy Markdown
Contributor

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

Summary

  • recognize native Windows synchronized-output frames whose final cursor show is followed by a cursor placement before the end marker
  • rewrite that protected cursor tail so the cursor is placed before it is shown, avoiding an intermediate paint at the prior cell
  • add a scheduler regression that fails when this frame waits for the fallback or writes show-before-place bytes

Validation

  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler.test.ts
  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler.test.ts src/renderer/src/components/terminal-pane/pty-connection.test.ts
  • pnpm exec oxlint src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler.ts src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler.test.ts --quiet
  • pnpm run typecheck:web
  • pnpm run build:electron-vite
  • pnpm run test:e2e:terminal-perf

Notes

  • Tried to produce a fresh unpacked Windows package, but electron-builder hit local Windows file-lock/time-out issues before producing Orca.exe; no packaged validation is claimed from that attempt.

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — rewrites the cursor-show/cursor-position tail of synchronized-output frames on native Windows so the cursor is placed before it is shown, eliminating a flicker at the old cell.

  • findCursorPositionSequenceEnd — extracts the end index of the next CUP / CHA / HVP escape (H, G, f) after a given offset, matching the existing cursor-position-recognition pattern in containsCursorPositionSequence.
  • Rewrite in removeTransientCursorShowSequences — when a cursor-show has no subsequent hide but is followed by a cursor-position before data end, the position is sliced before the show. The comment captures the "why" cleanly.
  • containsFinalCursorPlacementBeforeSynchronizedEnd — within a synchronized frame, detects whether the final show is followed by a position before the end marker. Feeds into coalescedQueuedDataNeedsCursorRestore to skip the fallback cursor-restore pass when the inline rewrite already handles it.
  • Regression test — covers the show → position → sync-end pattern; asserts a single drain call (no fallback wait) and the reordered bytes.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

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