Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
make the prompt/status handle the cursor a little better
Browse files Browse the repository at this point in the history
  • Loading branch information
scoates committed Apr 12, 2011
1 parent c610d2b commit d4660ce
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion wshttp.js
Expand Up @@ -155,7 +155,12 @@ WsHttp.prototype = {
var self = this;
request.on('response', function (response) {
if (self.$_.printStatus) {
self.web_repl.outputStream.write(wsutil.formatStatus(response.statusCode, u, response.client.seq));
self.web_repl.outputStream.write(
'\x1b[1K'
+ '\x1b[' + (self.web_repl.rli._promptLength + self.web_repl.rli.line.length) + 'D'
+ wsutil.formatStatus(response.statusCode, u, response.client.seq)
+ '\x1b[B'
);
self.web_repl.displayPrompt();
}
self.$_.status = response.statusCode;
Expand Down

0 comments on commit d4660ce

Please sign in to comment.