diff --git a/src/vs/workbench/contrib/terminal/browser/terminalTabbedView.ts b/src/vs/workbench/contrib/terminal/browser/terminalTabbedView.ts index db3775dc0d8..e26e28b96a9 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalTabbedView.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalTabbedView.ts @@ -342,7 +342,8 @@ export class TerminalTabbedView extends Disposable { } layout(width: number, height: number): void { - this._height = height; + const chatItemHeight = this._chatEntry?.element.style.display === 'none' ? 0 : this._chatEntry?.element.clientHeight; + this._height = height - (chatItemHeight ?? 0); this._width = width; this._splitView.layout(width); if (this._shouldShowTabs()) { diff --git a/src/vs/workbench/contrib/terminal/browser/terminalView.ts b/src/vs/workbench/contrib/terminal/browser/terminalView.ts index 7c0f6bad08b..5eed1d4f713 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalView.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalView.ts @@ -106,10 +106,7 @@ export class TerminalViewPane extends ViewPane { if (!this._terminalTabbedView) { this._createTabsView(); } - // If we just opened our first terminal, layout - if (this._terminalGroupService.instances.length === 1) { - this.layoutBody(this._parentDomElement.offsetHeight, this._parentDomElement.offsetWidth); - } + this.layoutBody(this._parentDomElement.offsetHeight, this._parentDomElement.offsetWidth); })); this._dropdownMenu = this._register(this._menuService.createMenu(MenuId.TerminalNewDropdownContext, this._contextKeyService)); this._singleTabMenu = this._register(this._menuService.createMenu(MenuId.TerminalTabContext, this._contextKeyService));