From 3a57c8d7521e1f116f5b760dc80820c75ef8ccf1 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 13 Apr 2020 06:22:55 -0700 Subject: [PATCH] Fix terminal visibility when first terminal is not shown This happened because the first terminal tab got created but since the element didn't exist yet it wasn't marked as hidden, which caused the actual active terminal to be pushed below it. Fixes #94714 --- src/vs/workbench/contrib/terminal/browser/terminalTab.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalTab.ts b/src/vs/workbench/contrib/terminal/browser/terminalTab.ts index 6e36047e1befd..43f83721f6cb1 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalTab.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalTab.ts @@ -218,6 +218,7 @@ export class TerminalTab extends Disposable implements ITerminalTab { private _terminalLocation: ViewContainerLocation = ViewContainerLocation.Panel; private _activeInstanceIndex: number; + private _isVisible: boolean = false; public get terminalInstances(): ITerminalInstance[] { return this._terminalInstances; } @@ -356,6 +357,8 @@ export class TerminalTab extends Disposable implements ITerminalTab { this._splitPaneContainer = newLocal; this.terminalInstances.forEach(instance => this._splitPaneContainer!.split(instance)); } + + this.setVisible(this._isVisible); } public get title(): string { @@ -369,6 +372,7 @@ export class TerminalTab extends Disposable implements ITerminalTab { } public setVisible(visible: boolean): void { + this._isVisible = visible; if (this._tabElement) { this._tabElement.style.display = visible ? '' : 'none'; }