Skip to content

plugin install spinner outputs garbage in non-TTY environment #27908

@lunqin123

Description

@lunqin123

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

  1. Run from PowerShell: opencode plugin install opencode-session-search
  2. 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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtui

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions