#262·ora

Completion can skip spinner and cursor cleanup

Author: januththedevCreated Sep 24, 2026Updated Sep 25, 2026

Description

Ora's mutable isSilent and isEnabled flags can prevent completion methods from restoring state that start() changed.

stopAndPersist() currently returns before calling stop() when isSilent is true, leaving the animation interval active. Separately, stop() only restores the cursor when isEnabled is currently true, so disabling output after start() can leave the cursor hidden.

Steps to reproduce

javascript
import ora from 'ora';

const spinner = ora('Working').start();
spinner.isSilent = true;
spinner.succeed();
console.log(spinner.isSpinning); // currently true

const second = ora('Working').start();
second.isEnabled = false;
second.stop(); // cursor can remain hidden

Expected behavior

Completion methods always stop the spinner and restore terminal state, while silent mode suppresses persisted output rather than lifecycle cleanup.

Actual behavior

stopAndPersist() can leave isSpinning === true, and stop() can skip cursor restoration after isEnabled is changed.

A focused fix now tracks whether start() hid the cursor and calls stop() before the silent-output early return. Regression tests for both cases pass locally. I searched existing issues and pull requests for these state transitions and did not find a matching report.