Skip to content

Reduce spinner flickering - #182

Merged
timriley merged 1 commit into
mainfrom
fix-spinner-flicker
Nov 6, 2026
Merged

timriley merged 1 commit into
mainfrom
fix-spinner-flicker

Conversation

@timriley

@timriley timriley commented Nov 6, 2026

Copy link
Copy Markdown
Member

Instead of clearing the line and rewriting from the beginning (which can lead to flickering for terminals that refresh very quickly, because they show the line in its temporarily blank state), draw over the previous frame and then clear any remaining characters to the right hand side.

I tested this with hanami-cli main and the spinner states under the "Installing" step look a whole lot better now (Ghostty on macOS), whereas previously they were flickering.

Instead of clearing the line and rewriting from the beginning (which can lead to flickering for terminals that refresh very quickly, because they show the line in its temporarily blank state), draw _over_ the previous frame and then clear any remining characters to the right hand side.
@timriley
timriley requested a review from alassek November 6, 2026 00:59

@alassek alassek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

High-speed terminals change the conventional wisdom 👍

@timriley
timriley merged commit 9034d12 into main Nov 6, 2026
7 checks passed
@timriley
timriley deleted the fix-spinner-flicker branch November 6, 2026 09:00
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.

2 participants