fix: silence plugin spinner outside TTY
Issue for this PR
Closes #27908
Type of change
- [x] Bug fix
- [ ] New feature
- [ ] Refactor / code improvement
- [ ] Documentation
What does this PR do?
opencode plugin currently creates the animated spinner even when stdout is not a TTY. In non-interactive output this can emit spinner control text instead of quiet command output.
This PR keeps the existing spinner behavior for interactive terminals, but uses a no-op spinner when stdout is not a TTY. The change is scoped to the plugin command spinner creation path and adds a regression test for the non-TTY case.
The duplicate check flagged related PRs. This PR specifically targets the plugin install spinner path and includes a focused regression test for non-TTY spinner start/stop output.
How did you verify your code works?
bun test test/plugin/install.test.ts
Screenshots / recordings
Not applicable. This is a CLI output behavior fix covered by a regression test.
Checklist
- [x] I have tested my changes locally
- [x] I have not included unrelated changes in this PR
The following comment was made by an LLM, it may be inaccurate:
Potential Duplicate/Related PRs Found
⚠️ Multiple existing PRs address similar issues:
-
#27951 -
fix: use static plugin spinner outside TTY- Directly related to the same plugin spinner TTY issue
-
#28944 -
fix(opencode): avoid spinner noise in non-tty plugin install- Specifically targets plugin install spinner noise in non-TTY environments
-
#29601 -
fix(tui): prevent spinner garbage in non-TTY environments- Addresses spinner output in non-TTY environments
-
#31598 -
fix(cli): disable spinner animation in non-TTY environments- Similar fix for spinner animation in non-TTY contexts
Recommendation: Check the status and scope of PRs #27951 and #28944 in particular, as they appear to target the same plugin spinner TTY problem. PR #32317 may need to be reconciled with any already-merged solutions or consolidated if these are still open.
Thanks for updating your PR! It now meets our contributing guidelines. :+1: