Browse Source

repl: make sure the REPL always flushes with a newline

v0.9.1-release
Nathan Rajlich 13 years ago
committed by Bert Belder
parent
commit
b7ddd30181
  1. 6
      lib/repl.js

6
lib/repl.js

@ -138,6 +138,8 @@ function REPLServer(prompt, stream, eval, useGlobal, ignoreUndefined) {
var sawSIGINT = false;
rli.on('SIGINT', function() {
rli.output.write('\n');
if (sawSIGINT) {
rli.pause();
self.emit('exit');
@ -149,10 +151,8 @@ function REPLServer(prompt, stream, eval, useGlobal, ignoreUndefined) {
if (!(self.bufferedCommand && self.bufferedCommand.length > 0) &&
rli.line.length === 0) {
rli.output.write('\n(^C again to quit)\n');
rli.output.write('(^C again to quit)\n');
sawSIGINT = true;
} else {
rli.output.write('\n');
}
self.bufferedCommand = '';

Loading…
Cancel
Save