Repository navigation
Conversation
…nchronized output
🦋 Changeset detectedLatest commit: d5b9ae7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
vazome
marked this pull request as ready for review
November 22, 2026 16:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Eliminates visible spinner and progress bar flickering on low-latency GPU terminals (reproduced on macOS Ghostty as well as Linux Ptyxis/VTE in #613).
Root cause
On every 80ms tick,
spinner()previously cleared the entire region witherase.down()(CSI J) and then wrote the new frame across 3–4 separateoutput.write()calls (cursor.up,cursor.to(0),erase.down(), then the frame). Terminals that paint promptly on PTY reads (like Ghostty and Ptyxis) render the intermediate blank state betweenerase.down()and the new frame, causing visible strobing. Batching the oldESC[1G+ESC[J+ text sequence alone still passes through a blank erased state.Fix
erase.lineEnd(CSI K) instead of callingerase.down()before drawing. Only appenderase.down()after drawing when a multi-line frame shrinks to fewer rows.output.write()per frame (both on ticks and on_stop()).\x1b[?2026h…\x1b[?2026l) around interactive frame writes (skipped in CI mode). Supported natively by Ghostty, VTE/Ptyxis, Kitty, WezTerm, iTerm2, Alacritty, and xterm.js 6+; ignored by terminals that do not implement private mode 2026.Because
progress()delegates tospinner(), this fixes bothspinner()andprogress().Closes #613
Type of change
Checklist
pnpm testpasses (or targeted tests for my change) —spinner.test.ts,progress-bar.test.ts,spinner-accessible.test.ts(118/118),pnpm types, andpnpm run buildpasspnpm formathas been runAI-generated code disclosure