-
-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ctrl + c not working #156
Comments
4.0.4 should have fixed that issue. What OS and Node.js version? // @stroncium |
macos 10.12.6 |
works for me, node V14.2.0 |
I did experience the same issue on 5.1.0. What worked for me was to set both |
Same here. Tried on the latest version - 5.3.0. Ctrl+C doesn't work. node v12.20.0. Here is how it can be reproduced quickly. (@sindresorhus , if you want to give it a try). const spinner = ora({ spinner: 'dots' });
spinner.start('writing files...')
writeSync();
function writeSync(count = 80000) {
for (let i = 0; i < count; i+=1) {
fs.writeFileSync(`test.txt`, 'hello world');
}
} Run this, it'll create the same file "test.txt" multiple times, during the run, Ctrl+C won't respond until Ora is removed. I also tried The @alan-agius4 suggestion is the only way I could get it worked. |
Currently, it's mostly noticeable during bit build command at the typescript compilation step. It seems to be a bug in Ora package, see here for more info: sindresorhus/ora#156 I tried the suggested workaround there and it's working.
This is not so much an issue with Ora as it is with JavaScript being single-threaded. Both the cursor hiding and stdin discarding features have to register a listener for when Ctrl+C is pressed so they can clean up on exit. However, the Possible solutions for you:
nodejs/tooling#42 might fix this. So please do vote up and comment on that issue. |
version: v3.4.0
my code:
When i press
ctrl + c
duringmyTask
exection , nothing happened.After I remove code relative to ora, all is well.
I have upgraded to v4.0.4 and don't help
The text was updated successfully, but these errors were encountered: