Skip to content

tui: fix animated spinners inside terminal multiplexers#2035

Merged
dgageot merged 1 commit intodocker:mainfrom
dgageot:board/tmux-spinner-eae12e22
Mar 10, 2026
Merged

tui: fix animated spinners inside terminal multiplexers#2035
dgageot merged 1 commit intodocker:mainfrom
dgageot:board/tmux-spinner-eae12e22

Conversation

@dgageot
Copy link
Member

@dgageot dgageot commented Mar 10, 2026

Two changes improve spinner rendering in tmux and screen:

  1. Cap the Bubble Tea renderer at 30 FPS when a multiplexer is detected. The default 60 FPS can overwhelm the multiplexer's rendering pipeline, causing dropped frames that make spinners appear static.

  2. Fall back to ASCII spinner frames (|, /, -, \) instead of braille characters, which may not render correctly in every multiplexer configuration.

Multiplexer detection checks $TMUX, $STY, and the $TERM prefix (tmux*, screen*) so it still triggers when individual env vars are stripped (containers, sudo, etc.).

Assisted-By: docker-agent

Two changes improve spinner rendering in tmux and screen:

1. Cap the Bubble Tea renderer at 30 FPS when a multiplexer is
   detected. The default 60 FPS can overwhelm the multiplexer's
   rendering pipeline, causing dropped frames that make spinners
   appear static.

2. Fall back to ASCII spinner frames (|, /, -, \\) instead of
   braille characters, which may not render correctly in every
   multiplexer configuration.

Multiplexer detection checks $TMUX, $STY, and the $TERM prefix
(tmux*, screen*) so it still triggers when individual env vars are
stripped (containers, sudo, etc.).

Assisted-By: docker-agent
@dgageot dgageot requested a review from a team as a code owner March 10, 2026 14:32
Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

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

Review Summary

Assessment: 🟢 APPROVE

The implementation correctly detects terminal multiplexers and applies appropriate rendering optimizations:

FPS limiting: Caps Bubble Tea renderer at 30 FPS when multiplexers detected, preventing dropped frames
Spinner fallback: Uses ASCII frames (|, /, -, \) instead of braille characters in multiplexers
Robust detection: Checks $TMUX, $STY, and $TERM prefixes to handle stripped environments
Test coverage: Comprehensive unit tests for frame selection and multiplexer detection
No resource leaks: Package-level variable initialization is safe and efficient

The code follows Go best practices with no bugs detected in the changed code.

@dgageot dgageot merged commit f3168fb into docker:main Mar 10, 2026
8 checks passed
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