update files

This commit is contained in:
nuintun 2015-11-24 23:13:29 +08:00
parent 8c49cd09d1
commit 3efac1f18a
2 changed files with 12 additions and 14 deletions

View File

@ -119,7 +119,7 @@ module.exports = Vue.component('app-main', {
' \u001b[31mreturn\u001b[39m \u001b[37mhypernal\u001b[39m\u001b[90m;\u001b[39m', ' \u001b[31mreturn\u001b[39m \u001b[37mhypernal\u001b[39m\u001b[90m;\u001b[39m',
'\u001b[33m}\u001b[39m\u001b[90m;\u001b[39m', '\u001b[33m}\u001b[39m\u001b[90m;\u001b[39m',
new Date().toISOString() new Date().toISOString()
]; ].join('\r\n');
if (!runtime) { if (!runtime) {
var xterm = new Terminal(); var xterm = new Terminal();
@ -129,10 +129,8 @@ module.exports = Vue.component('app-main', {
console.log(xterm); console.log(xterm);
test.forEach(function (line){ xterm.write(test);
xterm.write(line); xterm.scroll();
scroll(xtermNode);
});
window.xterm = xterm; window.xterm = xterm;
@ -142,14 +140,14 @@ module.exports = Vue.component('app-main', {
xterm: xterm xterm: xterm
} }
} else { } else {
test.forEach(function (line){ runtime.xterm.writeln(test);
runtime.xterm.writeln(line); console.log('before', runtime.xterm.y);
console.log(runtime.xterm.rows); if (runtime.xterm.y > 10) {
if(runtime.xterm.y > 10){ runtime.xterm.deleteLines([1]);
runtime.xterm.eraseLine(0); console.log('after', runtime.xterm.y);
//runtime.xterm.refresh(0, runtime.xterm.y);
} }
scroll(xtermNode); runtime.xterm.scroll();
});
} }
}, },
setting: function (){ setting: function (){

View File

@ -22,7 +22,7 @@ function Terminal(opts){
this.y = 0; this.y = 0;
this.cursorState = 0; this.cursorState = 0;
this.cursorHidden = false; this.cursorHidden = false;
this.convertEol = false; this.convertEol = true;
this.state = states.normal; this.state = states.normal;
this.queue = ''; this.queue = '';
this.scrollTop = 0; this.scrollTop = 0;