mirror of
https://github.com/nuintun/command-manager.git
synced 2025-06-07 11:34:05 +08:00
update files
This commit is contained in:
parent
c031a18d4e
commit
99eccf36b3
@ -53,26 +53,34 @@ function scroll(xterm, parent){
|
|||||||
* @param xtermNode
|
* @param xtermNode
|
||||||
*/
|
*/
|
||||||
function createXTerm(name, xtermNode){
|
function createXTerm(name, xtermNode){
|
||||||
|
var timer;
|
||||||
var runtime = window.AppRuntime[name];
|
var runtime = window.AppRuntime[name];
|
||||||
|
|
||||||
if (runtime) {
|
if (runtime) {
|
||||||
runtime.xterm.focus();
|
runtime.xterm.focus();
|
||||||
xtermNode.innerHTML = runtime.xterm.screen;
|
|
||||||
} else {
|
} else {
|
||||||
var xterm = new Terminal({
|
var xterm = new Terminal({
|
||||||
rows: 66,
|
rows: 66,
|
||||||
scrollback: 66,
|
scrollback: 66,
|
||||||
cursorBlink: false,
|
|
||||||
convertEOL: true,
|
convertEOL: true,
|
||||||
fgColor: 'inherit',
|
fgColor: 'inherit',
|
||||||
bgColor: 'transparent'
|
bgColor: 'transparent',
|
||||||
|
onscreen: function (screen){
|
||||||
|
if (Terminal.focus === this) {
|
||||||
|
clearTimeout(timer);
|
||||||
|
|
||||||
|
timer = setTimeout(function (){
|
||||||
|
xtermNode.innerHTML = screen;
|
||||||
|
|
||||||
|
scroll(xterm, xtermNode);
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
xterm.open();
|
xterm.open();
|
||||||
xterm.focus();
|
xterm.focus();
|
||||||
|
|
||||||
xtermNode.innerHTML = xterm.screen;
|
|
||||||
|
|
||||||
window.AppRuntime[name] = {
|
window.AppRuntime[name] = {
|
||||||
xterm: xterm
|
xterm: xterm
|
||||||
};
|
};
|
||||||
@ -181,8 +189,6 @@ module.exports = Vue.component('app-main', {
|
|||||||
context.expandCommand = trigger && trigger.contains(target);
|
context.expandCommand = trigger && trigger.contains(target);
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
var timer;
|
|
||||||
|
|
||||||
ipc.on('emulator', function (event, type, project, data){
|
ipc.on('emulator', function (event, type, project, data){
|
||||||
var runtime = window.AppRuntime[project.name];
|
var runtime = window.AppRuntime[project.name];
|
||||||
|
|
||||||
@ -199,18 +205,7 @@ module.exports = Vue.component('app-main', {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
clearTimeout(timer);
|
|
||||||
runtime.xterm.write(data);
|
runtime.xterm.write(data);
|
||||||
|
|
||||||
if (project.name === context.project.name) {
|
|
||||||
timer = setTimeout(function (){
|
|
||||||
var xtermNode = context.$els.terminal;
|
|
||||||
|
|
||||||
xtermNode.innerHTML = runtime.xterm.screen;
|
|
||||||
|
|
||||||
scroll(runtime.xterm, xtermNode);
|
|
||||||
}, 0);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
event.sender.send('emulator', project, 'stop');
|
event.sender.send('emulator', project, 'stop');
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,8 @@ module.exports = function (Terminal){
|
|||||||
Terminal.focus.blur();
|
Terminal.focus.blur();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Terminal.focus = this;
|
||||||
|
|
||||||
if (this.cursor) {
|
if (this.cursor) {
|
||||||
this.showCursor();
|
this.showCursor();
|
||||||
}
|
}
|
||||||
@ -24,8 +26,6 @@ module.exports = function (Terminal){
|
|||||||
if (this.cursorBlink) {
|
if (this.cursorBlink) {
|
||||||
this.startBlink();
|
this.startBlink();
|
||||||
}
|
}
|
||||||
|
|
||||||
Terminal.focus = this;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user