diff --git a/terminus-core/src/components/splitTab.component.ts b/terminus-core/src/components/splitTab.component.ts index a13aaa3b..71582de2 100644 --- a/terminus-core/src/components/splitTab.component.ts +++ b/terminus-core/src/components/splitTab.component.ts @@ -189,7 +189,11 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes this.focused$.subscribe(() => { this.getAllTabs().forEach(x => x.emitFocused()) - this.focus(this.focusedTab) + if (this.focusedTab) { + this.focus(this.focusedTab) + } else { + this.focusAnyIn(this.root) + } }) this.blurred$.subscribe(() => this.getAllTabs().forEach(x => x.emitBlurred())) @@ -235,8 +239,10 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes await this.recoverContainer(this.root, this._recoveredState) this.layout() setImmediate(() => { - this.getAllTabs().forEach(x => x.emitFocused()) - this.focusAnyIn(this.root) + if (this.hasFocus) { + this.getAllTabs().forEach(x => x.emitFocused()) + this.focusAnyIn(this.root) + } }) } } diff --git a/terminus-terminal/src/api/baseTerminalTab.component.ts b/terminus-terminal/src/api/baseTerminalTab.component.ts index 435e4f3f..ef5739d2 100644 --- a/terminus-terminal/src/api/baseTerminalTab.component.ts +++ b/terminus-terminal/src/api/baseTerminalTab.component.ts @@ -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()