File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -1546,8 +1546,7 @@ Interface.prototype.repl = function() {
1546
1546
var listeners = this . repl . rli . listeners ( 'SIGINT' ) . slice ( 0 ) ;
1547
1547
this . repl . rli . removeAllListeners ( 'SIGINT' ) ;
1548
1548
1549
- // Exit debug repl on Ctrl + C
1550
- this . repl . rli . once ( 'SIGINT' , function ( ) {
1549
+ function exitDebugRepl ( ) {
1551
1550
// Restore all listeners
1552
1551
process . nextTick ( function ( ) {
1553
1552
listeners . forEach ( function ( listener ) {
@@ -1557,7 +1556,16 @@ Interface.prototype.repl = function() {
1557
1556
1558
1557
// Exit debug repl
1559
1558
self . exitRepl ( ) ;
1560
- } ) ;
1559
+
1560
+ self . repl . rli . removeListener ( 'SIGINT' , exitDebugRepl ) ;
1561
+ self . repl . removeListener ( 'exit' , exitDebugRepl ) ;
1562
+ }
1563
+
1564
+ // Exit debug repl on SIGINT
1565
+ this . repl . rli . on ( 'SIGINT' , exitDebugRepl ) ;
1566
+
1567
+ // Exit debug repl on repl exit
1568
+ this . repl . on ( 'exit' , exitDebugRepl ) ;
1561
1569
1562
1570
// Set new
1563
1571
this . repl . eval = this . debugEval . bind ( this ) ;
You can’t perform that action at this time.
0 commit comments