fix(cli): avoid spinner escape spam on plugin install in non-TTY#32440
fix(cli): avoid spinner escape spam on plugin install in non-TTY#324400xDevNinja wants to merge 1 commit into
Conversation
The plugin install command uses the clack spinner, which animates via carriage returns and ANSI escapes. In a non-TTY (CI, subprocess, piped PowerShell) those are not interpreted, so every frame is printed as a separate line with the message repeated. Guard the default spinner with a process.stdout.isTTY check and fall back to plain static text when stdout is not a terminal. Closes anomalyco#27908
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate PRs FoundBased on the search results, there are several related PRs addressing similar non-TTY spinner issues:
PRs #32317 and #27951 appear to be the most directly related, as they specifically target the plugin install spinner behavior in non-TTY environments, which is exactly what PR #32440 addresses. |
Issue for this PR
Closes #27908
Type of change
What does this PR do?
opencode plugin installuses the clack spinner, which animates by emitting carriage returns and ANSI escape sequences. In a non-TTY environment (CI, a subprocess, a piped PowerShell session) those control characters are not interpreted, so every animation frame is printed on its own line withInstalling plugin package...repeated.This guards the default spinner factory with a
process.stdout.isTTYcheck (the same approach already used incli/ui.ts). When stdout is not a terminal it falls back to a static spinner that writes the start/stop message once as plain text, with no escape sequences. TTY behavior is unchanged.How did you verify your code works?
bun typecheckpasses.bun test test/plugin/install.test.ts-> 21 pass.defaultPlugDeps; the existing tests inject their own spinner viaPlugDeps, so production behavior is the only thing affected and the test surface is unchanged.Screenshots / recordings
N/A - CLI output change, no UI.
Checklist