From 3efac1f18a0df4767b347752558f6648bd9e736f Mon Sep 17 00:00:00 2001 From: nuintun Date: Tue, 24 Nov 2015 23:13:29 +0800 Subject: [PATCH] update files --- static/js/components/app-main/index.js | 24 +++++++++++------------- static/js/terminal/index.js | 2 +- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/static/js/components/app-main/index.js b/static/js/components/app-main/index.js index 243d989..a6ad409 100644 --- a/static/js/components/app-main/index.js +++ b/static/js/components/app-main/index.js @@ -119,7 +119,7 @@ module.exports = Vue.component('app-main', { ' \u001b[31mreturn\u001b[39m \u001b[37mhypernal\u001b[39m\u001b[90m;\u001b[39m', '\u001b[33m}\u001b[39m\u001b[90m;\u001b[39m', new Date().toISOString() - ]; + ].join('\r\n'); if (!runtime) { var xterm = new Terminal(); @@ -129,10 +129,8 @@ module.exports = Vue.component('app-main', { console.log(xterm); - test.forEach(function (line){ - xterm.write(line); - scroll(xtermNode); - }); + xterm.write(test); + xterm.scroll(); window.xterm = xterm; @@ -142,14 +140,14 @@ module.exports = Vue.component('app-main', { xterm: xterm } } else { - test.forEach(function (line){ - runtime.xterm.writeln(line); - console.log(runtime.xterm.rows); - if(runtime.xterm.y > 10){ - runtime.xterm.eraseLine(0); - } - scroll(xtermNode); - }); + runtime.xterm.writeln(test); + console.log('before', runtime.xterm.y); + if (runtime.xterm.y > 10) { + runtime.xterm.deleteLines([1]); + console.log('after', runtime.xterm.y); + //runtime.xterm.refresh(0, runtime.xterm.y); + } + runtime.xterm.scroll(); } }, setting: function (){ diff --git a/static/js/terminal/index.js b/static/js/terminal/index.js index d83215d..4f975dd 100644 --- a/static/js/terminal/index.js +++ b/static/js/terminal/index.js @@ -22,7 +22,7 @@ function Terminal(opts){ this.y = 0; this.cursorState = 0; this.cursorHidden = false; - this.convertEol = false; + this.convertEol = true; this.state = states.normal; this.queue = ''; this.scrollTop = 0;