Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions apps/cli/src/shared/output/output.layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,20 @@ export const textOutputLayer = Layer.effect(
: Effect.sync(() => log.info(JSON.stringify(event))),
task: (message: string) =>
Effect.sync(() => {
if (!tty.stdoutIsTty) {
// Non-TTY stdout (CI, pipe, redirect) — suppress the @clack spinner,
// which writes cursor-hide and animated-frame ANSI to stdout and
// pollutes machine-parsed output. See supabase/cli#5397.
const noop = () => Effect.void;
return {
message: noop,
succeed: noop,
fail: noop,
info: noop,
cancel: noop,
clear: noop,
};
}
let shown = false;
let settled = false;
let currentMessage = message;
Expand Down
15 changes: 15 additions & 0 deletions apps/cli/src/shared/output/output.layer.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,21 @@ describe("Output", () => {
}).pipe(Effect.provide(layer)),
);

it.effect("task suppresses the spinner entirely when stdout is not a TTY", () =>
Effect.gen(function* () {
vi.useFakeTimers();
const out = yield* Output;
const task = yield* out.task("Fetching branches...");
vi.advanceTimersByTime(1000);
yield* task.clear();

expect(mockClack.spinnerFactory).not.toHaveBeenCalled();
expect(mockClack.spinnerHandle.start).not.toHaveBeenCalled();
}).pipe(
Effect.provide(textOutputLayer.pipe(Layer.provide(mockTty({ stdoutIsTty: false })))),
),
);

it.effect("task prefixes continuation lines for multiline completions", () =>
Effect.gen(function* () {
vi.useFakeTimers();
Expand Down