Skip to content
Prev Previous commit
Next Next commit
chore: fix rendering order
  • Loading branch information
43081j committed Feb 24, 2026
commit 505e7ff15fb278dbe1f14ee7b61098091e4633d5
10 changes: 5 additions & 5 deletions packages/core/src/prompts/spinner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class SpinnerPrompt extends Prompt<undefined> {
#onCancel?: () => void;
#message: string = '';
#silentExit: boolean = false;
#exitCode: number | undefined = undefined;
#exitCode: number = 0;

constructor(opts: SpinnerOptions) {
super(opts);
Expand Down Expand Up @@ -64,7 +64,7 @@ export default class SpinnerPrompt extends Prompt<undefined> {

this.#reset();
this.#silentExit = silent === true;
this.#exitCode = exitCode;
this.#exitCode = exitCode ?? 0;

if (msg !== undefined) {
this.#message = msg;
Expand Down Expand Up @@ -116,7 +116,7 @@ export default class SpinnerPrompt extends Prompt<undefined> {

#reset(): void {
this.#isActive = false;
this.#exitCode = undefined;
this.#exitCode = 0;

if (this.#intervalId) {
clearInterval(this.#intervalId);
Expand All @@ -127,11 +127,11 @@ export default class SpinnerPrompt extends Prompt<undefined> {
}

#onInterval(): void {
this.render();

this.#frameIndex = this.#frameIndex + 1 < this.#frames.length ? this.#frameIndex + 1 : 0;
// indicator increase by 1 every 8 frames
this.#indicatorTimer = this.#indicatorTimer < 4 ? this.#indicatorTimer + 0.125 : 0;

this.render();
}

#onProcessError: () => void = () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/prompts/src/spinner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const spinner = ({
const hasGuide = opts.withGuide ?? settings.withGuide;

if (!this.isActive) {
if (this.silentExit) {
if (this.silentExit || this.state === 'initial') {
return '';
}
const step =
Expand Down