Skip to content

Commit

Permalink
Fix terminal visibility when first terminal is not shown
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Tyriar committed Apr 13, 2020
1 parent 9187e9a commit 3a57c8d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/vs/workbench/contrib/terminal/browser/terminalTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down Expand Up @@ -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 {
Expand All @@ -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';
}
Expand Down

0 comments on commit 3a57c8d

Please sign in to comment.