From 40d80cf2ea90d7ca722806a6c3cc41952330927c Mon Sep 17 00:00:00 2001 From: nuintun Date: Fri, 4 Dec 2015 10:02:30 +0800 Subject: [PATCH] update files --- static/js/terminal/index.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/static/js/terminal/index.js b/static/js/terminal/index.js index a4ada93..5a2bea9 100644 --- a/static/js/terminal/index.js +++ b/static/js/terminal/index.js @@ -965,6 +965,25 @@ function AnsiTerminal(cols, rows, scrollLength){ */ AnsiTerminal.prototype.write = function (data){ this.AnsiParser.parse(data); + + // TODO cursor? + //// place cursor temporarily in buffer - needed to simplify fragment creation + //var node = this.screen.buffer[this.cursor.row].cells[this.cursor.col]; + // + //if (this.show_cursor && node) { + // node.attr |= 4194304; + //} + // + //this.screen.buffer[this.cursor.row].version++; + // + //// remove cursor from buffer + //node = this.screen.buffer[this.cursor.row].cells[this.cursor.col]; + // + //if (this.show_cursor && node) { + // node.attr &= ~4194304; + //} + // + //this.screen.buffer[this.cursor.row].version++; }; /** Hard reset of the terminal. */ @@ -1056,6 +1075,7 @@ AnsiTerminal.prototype.toString = function (type){ var rows = this.screen.buffer.length; if (type === 'html') { + var text = ''; var line = ''; var style = ''; var attrCache; @@ -1086,11 +1106,13 @@ AnsiTerminal.prototype.toString = function (type){ line += node.value.replace(/\s/g, ' '); } + + text += node.value; } line += ''; - if (this.screen.buffer[i].version > 0) { + if (text) { s += line; } else { s += '
 
';