mirror of https://github.com/nodejs/node.git
[debugger] display message on repl(), do not display warnings on Ctrl+C
parent
77eb8eabe2
commit
00343a9af0
|
@ -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();
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue