Skip to content

Commit

Permalink
[fix] #293 Exit script when SIGINT signal received (#564)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamreisnz authored and SBoudrias committed Jul 9, 2017
1 parent 625965e commit 5dbd186
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ui/baseUI.js
Expand Up @@ -18,8 +18,12 @@ var UI = module.exports = function (opt) {
this.onForceClose = this.onForceClose.bind(this);

// Make sure new prompt start on a newline when closing
this.rl.on('SIGINT', this.onForceClose);
process.on('exit', this.onForceClose);

// Terminate process on SIGINT (which will call process.on('exit') in return)
this.rl.on('SIGINT', function () {
process.exit(0);
});
};

/**
Expand Down

0 comments on commit 5dbd186

Please sign in to comment.