Uh oh!
There was an error while loading. Please reload this page.
fix(plug): skip spinner animation in non-TTY environments - #31444
fix(plug): skip spinner animation in non-TTY environments#31444deepshekhardas wants to merge 1 commit into
Conversation
When stdout is not a TTY (e.g., CI, piped output, PowerShell redirected), the @clack/prompts spinner outputs raw ANSI escape sequences and Unicode Braille frames as individual lines. Check process.stdout.isTTY and fall back to plain log messages when not interactive.
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
The following comment was made by an LLM, it may be inaccurate: I found potentially related PRs addressing similar spinner/TTY issues:
These PRs are addressing the same underlying issue (spinner behavior in non-TTY environments) across different packages. You should check if any of these are already merged or if there's overlap with the current PR #31444. |
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Description
When running \opencode plugin install\ in a non-TTY environment (e.g., CI, piped output, PowerShell with redirected stdout), the @clack/prompts\ spinner emits raw ANSI escape sequences and Unicode Braille frames as individual lines, producing garbage output.
Fix
Check \process.stdout.isTTY\ before creating the spinner. When not a TTY:
This is the minimal fix for the plugin install command. The same pattern applies to other CLI commands using @clack/prompts\ spinners (\upgrade, \uninstall, \mcp, \�gent), which can be fixed separately.
Related issues
Fixes#27908