ora: breaks other `process.on('SIGINT', ...)` handlers
When using ora, other exit related signal handlers fail to run:
// remove the next line, and "cleanup" prints.
require('ora')('Loading unicorns').start().stop();
process.on('SIGINT', function() {
// never called if ora was ever enabled
console.log('cleanup');
});
process.kill(process.pid, 'SIGINT');
This is due to: exit-hook used by restore-cursor not being friendly with other on-exit related strategies.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (7 by maintainers)
Commits related to this issue
- fix: should not enable ora when detail enable https://github.com/sindresorhus/ora/issues/27 — committed to cnpm/npminstall by fengmk2 7 years ago
- fix: should not enable ora when detail enable (#187) https://github.com/sindresorhus/ora/issues/27 — committed to cnpm/npminstall by fengmk2 7 years ago
- Handle wrapping, add hideCursor option (#69) * Conform with latest XO * Handle wrapped text Count how many rows are taken up by the spinner and the text and clear the appropriate number of lin... — committed to sindresorhus/ora by novemberborn 6 years ago
- fix: improved behavior w.r.t. ctrl+c cleanup when `ora` hides the cursor... it installs a SIGINT handler to clean up the hiding of the cursor. this causes major unreliability with ctrl+c handling. `... — committed to starpit/madwizard by starpit a year ago
- fix: improved behavior w.r.t. ctrl+c cleanup when `ora` hides the cursor... it installs a SIGINT handler to clean up the hiding of the cursor. this causes major unreliability with ctrl+c handling. `... — committed to guidebooks/madwizard by starpit a year ago
Hi! First and foremost thanks for the project. I’m learning how to write spinners for node by looking here 🎉. Also I’d like to give feedback but I don’t feel like it needs to be a new issue. Me and a friend ran on this SIGINT issue using Ora, and this thread was the only link between that behavior and the hideCursor option. We weren’t understanding why Ora was interfering in killing our CLI using ctrl+c. I think this should be mentioned in the readme, at the very least. Did you guys make hideCursor default to on to avoid introducing a breaking change?
👆🏻That leads me to believe it should default to off.