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

pull/22966/head
Fedor Indutny 2011-09-07 23:43:59 +07:00
parent 77eb8eabe2
commit 00343a9af0
1 changed files with 14 additions and 0 deletions

View File

@ -1009,8 +1009,22 @@ Interface.prototype.repl = function() {
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
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();
});