-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
debugger: also exit when the repl emits 'exit' #2369
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
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); | ||
|
||
|
|
||
| // 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+cisn't the only way to send aSIGINTto a procees, andexitcan also be caused byctrl+don an empty repl prompt.