diff --git a/lib/_debugger.js b/lib/_debugger.js index 9dceb8eaa7..9f25059423 100644 --- a/lib/_debugger.js +++ b/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