Open amadeus-8 opened 3 years ago
We have the same issue on Powershell when hitting CTRL+ C:
ExitPromptError: User force closed the prompt with 0 null
at path\node_modules\@inquirer\core\dist\cjs\lib\create-prompt.js:60:28
at Emitter.emit (path\node_modules\signal-exit\dist\cjs\index.js:71:19)
at #processEmit (path\node_modules\signal-exit\dist\cjs\index.js:240:27)
at #process.emit (path\node_modules\signal-exit\dist\cjs\index.js:191:37)
at process.callbackTrampoline (node:internal/async_hooks:128:17)
@raskyer is it the same issue? Is the problem the error itself? Or that even with the error the prompt doesn't exit?
I have both, for the error message I have fixed it with the solution from another ticket. I have added process.exit(0) in the catch and it seems to fix the issue but without it it's hanging.
process.exit()
forces the process to exit immediately.
Without it, Node waits for timeouts and other scheduled async operations to complete in order to safely exit. That's not specific to Inquirer.
I've created simple CLI using inquirer and child_process. And i have problem, when i'am closing process with CTLR+C, it seems like its still running process, because terminal not responding anything. And i have to close terminal every time and open it again, it's uncomfortable for me. What i need to do, to exit all processes with simple CTRL+C command? Searched so many solutions in google, but no result. Hope somebody can help me with it