Description
When running opencode plugin install <package> from a non-interactive shell (e.g., PowerShell, subprocess, CI), the spinner animation frames are printed as individual lines instead of being rendered in-place as an animation.
Reproduction
- Run from PowerShell:
opencode plugin install opencode-session-search
- Observe the output: each spinner frame (◓, ◑, ◒, ◐) appears on its own line with "Installing plugin package..." repeated
Root Cause
The plugin install command uses TUI spinner escape sequences (\r + ANSI CSI) without checking whether stdout is a TTY (via isatty). In non-interactive environments, carriage returns are not interpreted, so each frame becomes a separate line of output.
Expected Behavior
- In TTY: inline spinner animation (current behavior, correct)
- In non-TTY: simple static text like "Installing plugin package..." without escape sequences, or just silent with exit code
Environment
- OpenCode v1.15.3 (probably affects all versions)
- Windows 11, PowerShell 7
- Also affects CI/CD and subprocess invocations
Suggested Fix
Add an isatty check (e.g., Go's term.IsTerminal or Node's process.stdout.isTTY) before outputting spinner sequences. Fall back to plain text or no output when stdout is not a terminal.
Description
When running
opencode plugin install <package>from a non-interactive shell (e.g., PowerShell, subprocess, CI), the spinner animation frames are printed as individual lines instead of being rendered in-place as an animation.Reproduction
opencode plugin install opencode-session-searchRoot Cause
The
plugin installcommand uses TUI spinner escape sequences (\r + ANSI CSI) without checking whether stdout is a TTY (via isatty). In non-interactive environments, carriage returns are not interpreted, so each frame becomes a separate line of output.Expected Behavior
Environment
Suggested Fix
Add an isatty check (e.g., Go's term.IsTerminal or Node's process.stdout.isTTY) before outputting spinner sequences. Fall back to plain text or no output when stdout is not a terminal.