From b7ddd3018174b86c82f3e124e0c676c27cad045f Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Mon, 12 Mar 2012 17:29:21 -0700 Subject: [PATCH] repl: make sure the REPL always flushes with a newline --- lib/repl.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/repl.js b/lib/repl.js index 10a135f264..7fe29b3dd3 100644 --- a/lib/repl.js +++ b/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 = '';