Skip to content
Closed
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
19 changes: 15 additions & 4 deletions lib/cli/spinner.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ class Spinner {
spin(text = "Doing some work...") {
if (this.running) return;

// Don't show spinner in non-interactive environments (CI, pipes, etc.)
if (!stdout.isTTY || process.env.CI) {
return;
}

this.running = true;
// Remove the cursor so we can see the effect
Spinner.#removeCursor();
Expand Down Expand Up @@ -63,13 +68,19 @@ class Spinner {

stop() {
this.running = false;
readline.clearLine(process.stdout, 0);
// Only clear line if we're in a terminal and not in CI
if (stdout.isTTY && !process.env.CI) {
readline.clearLine(process.stdout, 0);
}
}

clear() {
Spinner.#addCursor();
readline.cursorTo(process.stdout, 0);
readline.clearLine(process.stdout, 0);
// Only clear if we're in a terminal and not in CI
if (stdout.isTTY && !process.env.CI) {
Spinner.#addCursor();
readline.cursorTo(process.stdout, 0);
readline.clearLine(process.stdout, 0);
}
}
}

Expand Down
Loading
Loading