Skip to content

fix(spinner): suppress spinner line clearing in raw output mode - #692

Merged
MarvinJWendt merged 4 commits into
pterm:masterfrom
jagregory:spinner-raw
Jun 6, 2025
Merged

MarvinJWendt merged 4 commits into
pterm:masterfrom
jagregory:spinner-raw

Conversation

@jagregory

Copy link
Copy Markdown
Contributor

Spinners with RawOutput enabled print lots of blank characters to logs, because the spinners are always calling sClearLine. Additionally, spinners without any text print several blank newlines to logs.

e.g.

^M                                                                                ^MDoing something
^M                                                                                ^MSUCCESS: Doing something

This PR suppresses line clearing when RawOutput is true, and only writes to the output if there's any text to write.

@MarvinJWendt MarvinJWendt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Thanks for contributing 🚀

I refactored the PR a little :)

@floaust floaust left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good! Thank you.

@MarvinJWendt
MarvinJWendt enabled auto-merge (squash) June 6, 2025 18:59
@MarvinJWendt
MarvinJWendt merged commit 0d3895d into pterm:master Jun 6, 2025
@MarvinJWendt MarvinJWendt changed the title Suppress spinner line clearing in raw output mode fix(spinner): suppress spinner line clearing in raw output mode Jun 6, 2025
@github-actions github-actions Bot added the fix label Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants