[PR #5486] fix(tui): normalize animated terminal output in bash tool #11426

Closed
opened 2026-02-16 18:16:15 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/5486

State: closed
Merged: No


Collapse spinner frames, progress bars, and status indicator lines that share the same base text to show only the latest frame. This prevents the TUI from displaying hundreds of redundant spinner animation frames when running CLI tools like ora or clack.

  • Add normalizeTerminalOutput utility to process terminal output
  • Strip ANSI codes before normalization for reliable detection
  • Handle carriage returns, spinner prefixes, progress bars, and dots
  • Track base text across lines with animated prefixes to collapse them

Before:

https://github.com/user-attachments/assets/7b8c4e11-f16d-4728-85f5-2a750fdd64c6

After:

https://github.com/user-attachments/assets/7b47d3ec-5f27-4b20-be7a-dfe27a756773

Reasoning:

For some CLI commands that show loading animations and such, it can lead to excess token consumption and it just breaks flow when looking at all of the animation styles streaming down.

Still a WIP, since we have a small graphical bug that causes a weird layout shift, almost an optimistic newline.

OC Session:

https://opncd.ai/share/9NfGjrUS

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/5486 **State:** closed **Merged:** No --- Collapse spinner frames, progress bars, and status indicator lines that share the same base text to show only the latest frame. This prevents the TUI from displaying hundreds of redundant spinner animation frames when running CLI tools like ora or clack. - Add normalizeTerminalOutput utility to process terminal output - Strip ANSI codes before normalization for reliable detection - Handle carriage returns, spinner prefixes, progress bars, and dots - Track base text across lines with animated prefixes to collapse them Before: https://github.com/user-attachments/assets/7b8c4e11-f16d-4728-85f5-2a750fdd64c6 After: https://github.com/user-attachments/assets/7b47d3ec-5f27-4b20-be7a-dfe27a756773 Reasoning: For some CLI commands that show loading animations and such, it can lead to excess token consumption and it just breaks flow when looking at all of the animation styles streaming down. Still a WIP, since we have a small graphical bug that causes a weird layout shift, almost an optimistic newline. OC Session: https://opncd.ai/share/9NfGjrUS
yindo added the pull-request label 2026-02-16 18:16:15 -05:00
yindo closed this issue 2026-02-16 18:16:15 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11426