update files

This commit is contained in:
nuintun
2015-11-26 17:13:52 +08:00
parent 0de48027f7
commit 887e6a74d4
3 changed files with 14 additions and 10 deletions

View File

@@ -192,6 +192,8 @@ module.exports = Vue.component('app-main', {
context.expandCommand = trigger && trigger.contains(target);
}, false);
var step = 0;
ipc.on('emulator', function (event, type, project, data){
var runtime = window.AppRuntime[project.name];
@@ -199,17 +201,22 @@ module.exports = Vue.component('app-main', {
switch (type) {
case 'data':
data += '';
step++;
break;
case 'error':
data = '执行出现错误: ' + data;
step = 0;
break;
case 'close':
data = '\u001b[32m命令执行完毕\u001b[39m\r\n';
step = 0;
break;
}
runtime.xterm.write(data + '');
scroll(runtime.xterm);
setTimeout(function (){
runtime.xterm.write(data + '');
scroll(runtime.xterm);
}, 10 * step);
} else {
event.sender.send('emulator', project, 'stop');
}