Browse Source

[debugger] display message on repl(), do not display warnings on Ctrl+C

Fedor Indutny 14 years ago
parent
commit
00343a9af0
  1. 14
      lib/_debugger.js

14
lib/_debugger.js

@ -1009,8 +1009,22 @@ Interface.prototype.repl = function() {
var self = this; var self = this;
console.log('Press Ctrl + C to leave debug repl');
// Don't display any default messages
var listeners = this.repl.rli.listeners('SIGINT');
this.repl.rli.removeAllListeners('SIGINT');
// Exit debug repl on Ctrl + C // Exit debug repl on Ctrl + C
this.repl.rli.once('SIGINT', function() { this.repl.rli.once('SIGINT', function() {
// Restore all listeners
process.nextTick(function() {
listeners.forEach(function(listener) {
self.repl.rli.on('SIGINT', listener);
});
});
// Exit debug repl
self.exitRepl(); self.exitRepl();
}); });

Loading…
Cancel
Save