Skip to content

Commit 48af0af

Browse files
committed
fix: stop spinner before streaming output to prevent double-rendering
The spinner was continuing to write to stderr every 80ms while command output was being streamed to stdout in tee/capture modes. This caused overlapping text as the spinner's carriage returns interfered with the markdown renderer's output. Added stopSpinner() calls at the start of both tee and capture mode blocks in runCommand() to ensure clean output.
1 parent 2c45e1e commit 48af0af

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/command.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,9 @@ export async function runCommand(ctx: RunContext): Promise<RunResult> {
408408

409409
// Handle output based on mode
410410
if (mode === "tee") {
411+
// Stop spinner before streaming output starts
412+
stopSpinner();
413+
411414
// Tee mode: stream to console while capturing (with markdown rendering)
412415
const promises: Promise<void>[] = [];
413416

@@ -429,6 +432,9 @@ export async function runCommand(ctx: RunContext): Promise<RunResult> {
429432

430433
await Promise.all(promises);
431434
} else if (mode === "capture") {
435+
// Stop spinner before reading output
436+
stopSpinner();
437+
432438
// Capture mode: buffer then print (with markdown rendering)
433439
if (proc.stdout) {
434440
stdout = await new Response(proc.stdout).text();

0 commit comments

Comments
 (0)