Browse Source

debugger: exit process on repl exit

* When entering repl - clone 'SIGINT' listeners array (instead of using
existing), as it will be spliced in .removeAllListeners() call later.
v0.9.1-release
Fedor Indutny 13 years ago
parent
commit
f61d4b7a87
  1. 6
      lib/_debugger.js

6
lib/_debugger.js

@ -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();
});
@ -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

Loading…
Cancel
Save