1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-10-06 02:23:26 +08:00

Focus terminal when switching instances

This commit is contained in:
Marcos Lilljedahl
2016-10-08 12:26:33 +02:00
parent 1d550aaa46
commit 991594c35c
2 changed files with 9 additions and 5 deletions

View File

@@ -37,7 +37,7 @@ function createTerminal(name) {
while (terminalContainer.children.length) {
terminalContainer.removeChild(terminalContainer.children[0]);
}
term = new Terminal({
var term = new Terminal({
cursorBlink: false
});
var sessionId = location.pathname.substr(location.pathname.lastIndexOf("/")+1);
@@ -47,12 +47,14 @@ function createTerminal(name) {
term.open(terminalContainer);
socket = new WebSocket(socketURL);
socket.onopen = runRealTerminal;
socket.onopen = runRealTerminal(term);
return term;
}
function runRealTerminal() {
function runRealTerminal(term) {
term.attach(socket);
term._initialized = true;
}