Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
debugger: exit process on repl exit
Browse files Browse the repository at this point in the history
* When entering repl - clone 'SIGINT' listeners array (instead of using
existing), as it will be spliced in .removeAllListeners() call later.
  • Loading branch information
indutny committed Mar 19, 2012
1 parent d8c4ece commit f61d4b7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/_debugger.js
Expand Up @@ -755,6 +755,10 @@ function Interface(stdin, stdout, args) {
this.controlEval.bind(this), false, true);

// Kill child process when main process dies
this.repl.on('exit', function() {
process.exit(0);
});

process.on('exit', function() {
self.killChild();
});
Expand Down Expand Up @@ -1486,7 +1490,7 @@ Interface.prototype.repl = function() {
self.print('Press Ctrl + C to leave debug repl');

// Don't display any default messages
var listeners = this.repl.rli.listeners('SIGINT');
var listeners = this.repl.rli.listeners('SIGINT').slice(0);
this.repl.rli.removeAllListeners('SIGINT');

// Exit debug repl on Ctrl + C
Expand Down

0 comments on commit f61d4b7

Please sign in to comment.