diff --git a/lib/_debugger.js b/lib/_debugger.js index b0fb61cc6c9..a97eca15ff4 100644 --- a/lib/_debugger.js +++ b/lib/_debugger.js @@ -867,7 +867,7 @@ Interface.prototype.childPrint = function(text) { }).map(function(chunk) { return '< ' + chunk; }).join('\n')); - this.repl.displayPrompt(); + this.repl.displayPrompt(true); }; // Errors formatting diff --git a/lib/readline.js b/lib/readline.js index a87ba1ea5d2..de484d3f323 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -125,9 +125,9 @@ Interface.prototype.setPrompt = function(prompt, length) { }; -Interface.prototype.prompt = function() { +Interface.prototype.prompt = function(preserveCursor) { if (this.enabled) { - this.cursor = 0; + if (!preserveCursor) this.cursor = 0; this._refreshLine(); } else { this.output.write(this._prompt); diff --git a/lib/repl.js b/lib/repl.js index 3a5ac4346e7..2c3baeba28d 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -282,11 +282,11 @@ REPLServer.prototype.resetContext = function(force) { this.context = context; }; -REPLServer.prototype.displayPrompt = function() { +REPLServer.prototype.displayPrompt = function(preserveCursor) { this.rli.setPrompt(this.bufferedCommand.length ? '...' + new Array(this.lines.level.length).join('..') + ' ' : this.prompt); - this.rli.prompt(); + this.rli.prompt(preserveCursor); };