From c4b7ece19102ed13f2d0bc8ddeabfcee54be370d Mon Sep 17 00:00:00 2001 From: Adam Reis Date: Tue, 25 Jul 2017 02:06:09 +1200 Subject: [PATCH] Better way to kill process (#569) As per https://github.com/SBoudrias/Inquirer.js/issues/293#issuecomment-315944753, this change still keeps the desired behaviour of killing the process on CTRL-C, but it gives parent processes a chance to clean up. --- lib/ui/baseUI.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ui/baseUI.js b/lib/ui/baseUI.js index 6ad080a85..b12264bb2 100644 --- a/lib/ui/baseUI.js +++ b/lib/ui/baseUI.js @@ -22,7 +22,7 @@ var UI = module.exports = function (opt) { // Terminate process on SIGINT (which will call process.on('exit') in return) this.rl.on('SIGINT', function () { - process.exit(0); + process.kill(process.pid, 'SIGINT'); }); };