[eas-cli] Stop spinners from repeating their text after a terminal resize - #4473
Closed
szdziedzic wants to merge 2 commits into
Closed
szdziedzic wants to merge 2 commits into
szdziedzic wants to merge 2 commits into
Conversation
…size Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
✅ Thank you for adding the changelog entry! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4473 +/- ##
==========================================
+ Coverage 72.43% 72.46% +0.04%
==========================================
Files 975 975
Lines 46620 46625 +5
Branches 10072 10072
==========================================
+ Hits 33763 33783 +20
+ Misses 11857 11842 -15
Partials 1000 1000 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Why
When you resize the terminal during
eas simulator, the "Simulator session active" spinner can print its text again on every frame. The screen fills with copies of the line.How
eas-cli uses ora 5.1.0. It counts how many terminal lines the spinner text wraps to only when the text changes. It uses that count to clear the previous frame. The simulator spinner text is long and wraps. When the terminal gets narrower, the text wraps to more lines, but the count stays the same. So each frame clears too few lines and leaves one copy behind.
The
ora()wrapper insrc/ora.tsnow recalculates the line count before each frame. It sets the text to its current value, because the text setter does the recalculation. All eas-cli spinners get the fix.Right after a resize, at most one stale line can stay behind, because the frame on screen was drawn at the old width. After that, the spinner clears correctly.
Test Plan
src/__tests__/ora-test.ts. It simulates a TTY that gets narrower from 200 to 40 columns and checks that each frame clears all 3 wrapped lines. The test fails without the fix (1 line cleared) and passes with it.yarn typecheck,yarn lint, andyarn fmt:checkpass.eas simulator, then make the terminal window narrower. The spinner line must not repeat.🤖 Generated with Claude Code