Skip to content

fix(plugin): prevent spinner garbage output in non-TTY environments#31529

Open
MD-Mushfiqur123 wants to merge 2 commits into
anomalyco:devfrom
MD-Mushfiqur123:fix/non-tty-spinner
Open

fix(plugin): prevent spinner garbage output in non-TTY environments#31529
MD-Mushfiqur123 wants to merge 2 commits into
anomalyco:devfrom
MD-Mushfiqur123:fix/non-tty-spinner

Conversation

@MD-Mushfiqur123

@MD-Mushfiqur123 MD-Mushfiqur123 commented Jun 9, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #27908

Type of change

  • Bug fix

What does this PR do?

When running opencode plugin install from non-interactive shells (PowerShell, CI/CD), the spinner animation outputs garbage — each frame (◓, ◑, ◒, ◐) appears on a new line because carriage returns are not interpreted in non-TTY environments.

The fix adds a createNonTTYSpinner() function that outputs plain text (msg... / msg done) instead of animated escape sequences when stdout is not a TTY.

How did you verify your code works?

  • npx tsc --noEmit passes with no errors
  • Pattern follows existing process.stdout.isTTY checks in the codebase (see packages/opencode/src/cli/ui.ts:49)

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Fixes anomalyco#27908

When running 'opencode plugin install' from non-interactive shells

(PowerShell, CI), spinner animation frames were printed as individual

lines instead of being rendered in-place.

Now checks process.stdout.isTTY before using animated spinner.

In non-TTY environments, falls back to simple static text output.
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential duplicate PRs found:

  1. fix(tui): prevent spinner garbage in non-TTY environments #29601 - fix(tui): prevent spinner garbage in non-TTY environments

  2. fix(opencode): avoid spinner noise in non-tty plugin install #28944 - fix(opencode): avoid spinner noise in non-tty plugin install

  3. fix: use static plugin spinner outside TTY #27951 - fix: use static plugin spinner outside TTY

All three PRs are addressing variations of the same core problem: spinner animation garbage output in non-TTY environments. You may want to check if these are already merged/closed or if there's overlap with the current PR #31529.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

plugin install spinner outputs garbage in non-TTY environment

1 participant