From abaea8ed1869adb92fdd3516a1bab06f9f04b921 Mon Sep 17 00:00:00 2001 From: nuintun Date: Wed, 25 Nov 2015 11:52:39 +0800 Subject: [PATCH] update files --- static/js/terminal/lib/refresh.js | 6 +++--- static/js/terminal/lib/scrollDisp.js | 2 ++ static/js/terminal/lib/write.js | 25 ------------------------- 3 files changed, 5 insertions(+), 28 deletions(-) diff --git a/static/js/terminal/lib/refresh.js b/static/js/terminal/lib/refresh.js index 5cdb918..3e6e5fb 100644 --- a/static/js/terminal/lib/refresh.js +++ b/static/js/terminal/lib/refresh.js @@ -121,17 +121,17 @@ module.exports = function (Terminal){ switch (ch) { case '&': - out += '&'; + out += '&'; break; case '<': - out += '<'; + out += '<'; break; case '>': out += '>'; break; default: if (ch <= ' ') { - out += ' '; + out += '>'; } else { if (this.isWide(ch)) i++; diff --git a/static/js/terminal/lib/scrollDisp.js b/static/js/terminal/lib/scrollDisp.js index ad644fc..99a211a 100644 --- a/static/js/terminal/lib/scrollDisp.js +++ b/static/js/terminal/lib/scrollDisp.js @@ -13,6 +13,8 @@ module.exports = function (Terminal){ this.lines = this.lines.slice(-(this.ybase + this.rows) + 1); } + console.log(this.ybase, this.scrollback); + this.ydisp = this.ybase; // last line diff --git a/static/js/terminal/lib/write.js b/static/js/terminal/lib/write.js index c1b5f7e..9649819 100644 --- a/static/js/terminal/lib/write.js +++ b/static/js/terminal/lib/write.js @@ -10,30 +10,6 @@ function fixLinefeed(data){ return data.replace(/([^\r])\n/g, '$1\r\n'); } -function fixIndent(data){ - if (!/(^|\n) /.test(data)) return data; - - // not very efficient, but works and would only become a problem - // once we render huge amounts of data - return data - .split('\n') - .map(function (line){ - var count = 0; - - while (line.charAt(0) === ' ') { - line = line.slice(1); - count++; - } - - while (count--) { - line = ' ' + line; - } - - return line; - }) - .join('\r\n'); -} - module.exports = function (Terminal){ Terminal.prototype.bell = function (){ var snd = new Audio('bell.wav'); // buffers automatically when created @@ -55,7 +31,6 @@ module.exports = function (Terminal){ Terminal.prototype.write = function (data){ data = fixLinefeed(data); - data = fixIndent(data); var l = data.length; var i = 0;