From bf6dbdfa135cec3b9193dbeb732b84adfb5a4e50 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Fri, 16 Dec 2022 12:10:00 -0800 Subject: [PATCH] Inline scroll bar height --- .../contrib/terminal/browser/terminalInstance.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts index 0eb0d7c691c..b990c5f2281 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts @@ -131,9 +131,12 @@ interface IGridDimensions { rows: number; } -const shellIntegrationSupportedShellTypes = [PosixShellType.Bash, PosixShellType.Zsh, PosixShellType.PowerShell, WindowsShellType.PowerShell]; - -const scrollbarHeight = 5; +const shellIntegrationSupportedShellTypes = [ + PosixShellType.Bash, + PosixShellType.Zsh, + PosixShellType.PowerShell, + WindowsShellType.PowerShell +]; export class TerminalInstance extends Disposable implements ITerminalInstance { private static _lastKnownCanvasDimensions: ICanvasDimensions | undefined; @@ -716,7 +719,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { const verticalPadding = parseInt(computedStyle.paddingTop) + parseInt(computedStyle.paddingBottom); TerminalInstance._lastKnownCanvasDimensions = new dom.Dimension( Math.min(Constants.MaxCanvasWidth, width - horizontalPadding), - height + (this._hasScrollBar && !this._horizontalScrollbar ? -scrollbarHeight : 0) - 2/* bottom padding */ - verticalPadding); + height + (this._hasScrollBar && !this._horizontalScrollbar ? -5/* scroll bar height */ : 0) - 2/* bottom padding */ - verticalPadding); return TerminalInstance._lastKnownCanvasDimensions; }