-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
debugger: also exit when the repl emits 'exit' #2369
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1546,8 +1546,7 @@ Interface.prototype.repl = function() { | |
var listeners = this.repl.rli.listeners('SIGINT').slice(0); | ||
this.repl.rli.removeAllListeners('SIGINT'); | ||
|
||
// Exit debug repl on Ctrl + C | ||
this.repl.rli.once('SIGINT', function() { | ||
function exitDebugRepl() { | ||
// Restore all listeners | ||
process.nextTick(function() { | ||
listeners.forEach(function(listener) { | ||
|
@@ -1557,7 +1556,16 @@ Interface.prototype.repl = function() { | |
|
||
// Exit debug repl | ||
self.exitRepl(); | ||
}); | ||
|
||
self.repl.rli.removeListener('SIGINT', exitDebugRepl); | ||
self.repl.removeListener('exit', exitDebugRepl); | ||
} | ||
|
||
// Exit debug repl on Ctrl + C | ||
this.repl.rli.on('SIGINT', exitDebugRepl); | ||
|
||
// Exit debug repl on '.exit' | ||
this.repl.on('exit', exitDebugRepl); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe prefer There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's still used in L762, or am I missing something? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, hmm. Carry on then. Maybe we should switch it eventually. |
||
|
||
// Set new | ||
this.repl.eval = this.debugEval.bind(this); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These comments aren't so correct imo.
ctrl+c
isn't the only way to send aSIGINT
to a procees, andexit
can also be caused byctrl+d
on an empty repl prompt.