delay frontend init if not focused (fixes #1147, fixes #1137)

This commit is contained in:
Eugene Pankov
2019-07-02 21:28:40 +02:00
parent 1fdf5367b6
commit d6c9ce84ea
2 changed files with 19 additions and 11 deletions

View File

@@ -174,15 +174,17 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
this.session.releaseInitialDataBuffer()
})
this.frontend.configure()
if (this.hasFocus) {
this.frontend.attach(this.content.nativeElement)
} else {
this.focused$.pipe(first()).subscribe(() => {
setImmediate(() => {
if (this.hasFocus) {
this.frontend.attach(this.content.nativeElement)
})
}
this.frontend.configure()
} else {
this.focused$.pipe(first()).subscribe(() => {
this.frontend.attach(this.content.nativeElement)
this.frontend.configure()
})
}
})
this.attachTermContainerHandlers()