From 6ed6df1d4da3c7060b3a08d301f0df6cdc14b5a4 Mon Sep 17 00:00:00 2001 From: deepshekhardas Date: Tue, 9 Jun 2026 07:02:48 +0530 Subject: [PATCH] fix(plug): skip spinner animation in non-TTY environments 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. --- packages/opencode/src/cli/cmd/plug.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/opencode/src/cli/cmd/plug.ts b/packages/opencode/src/cli/cmd/plug.ts index 1529e9b71df3..e009751ff2d3 100644 --- a/packages/opencode/src/cli/cmd/plug.ts +++ b/packages/opencode/src/cli/cmd/plug.ts @@ -1,4 +1,4 @@ -import { intro, log, outro, spinner } from "@clack/prompts" +import { intro, log, outro, spinner as clackSpinner } from "@clack/prompts" import { Effect } from "effect" import { ConfigPaths } from "@/config/paths" @@ -45,7 +45,12 @@ export type PlugCtx = { } const defaultPlugDeps: PlugDeps = { - spinner: () => spinner(), + spinner: () => { + if (process.stdout.isTTY) return clackSpinner() + const noop = (msg: string, code?: number) => {} + const start = (msg: string) => console.error(msg) + return { start, stop: noop } + }, log: { error: (msg) => log.error(msg), info: (msg) => log.info(msg),