|
@ -175,7 +175,7 @@ function REPLServer(prompt, stream, eval, useGlobal, ignoreUndefined) { |
|
|
|
|
|
|
|
|
rli.setPrompt(self.prompt); |
|
|
rli.setPrompt(self.prompt); |
|
|
|
|
|
|
|
|
rli.on('end', function() { |
|
|
rli.on('close', function() { |
|
|
self.emit('exit'); |
|
|
self.emit('exit'); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
@ -186,8 +186,7 @@ function REPLServer(prompt, stream, eval, useGlobal, ignoreUndefined) { |
|
|
|
|
|
|
|
|
if (!(self.bufferedCommand && self.bufferedCommand.length > 0) && empty) { |
|
|
if (!(self.bufferedCommand && self.bufferedCommand.length > 0) && empty) { |
|
|
if (sawSIGINT) { |
|
|
if (sawSIGINT) { |
|
|
rli.pause(); |
|
|
rli.close(); |
|
|
self.emit('exit'); |
|
|
|
|
|
sawSIGINT = false; |
|
|
sawSIGINT = false; |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
@ -807,8 +806,7 @@ function defineDefaultCommands(repl) { |
|
|
repl.defineCommand('exit', { |
|
|
repl.defineCommand('exit', { |
|
|
help: 'Exit the repl', |
|
|
help: 'Exit the repl', |
|
|
action: function() { |
|
|
action: function() { |
|
|
this.rli.pause(); |
|
|
this.rli.close(); |
|
|
this.emit('exit'); |
|
|
|
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|