diff options
author | Daniel Imms <2193314+Tyriar@users.noreply.github.com> | 2021-07-15 00:44:35 +0300 |
---|---|---|
committer | Daniel Imms <2193314+Tyriar@users.noreply.github.com> | 2021-07-15 00:44:35 +0300 |
commit | 5e159d1b9005a9041109a10fad0504518c75db07 (patch) | |
tree | 90597dfe20e9929f8a48ad3cf98ee2cb52b2da9d | |
parent | 3bea1f0db371a7c7e90a08725c442af3a75cdede (diff) |
Resize terminal when it's shown
This fixes the following case:
1. Create and split the terminal
2. Hide the panel
3. Create a terminal in the background
4. Show it, the dimensions were wrong
-rw-r--r-- | src/vs/workbench/contrib/terminal/browser/terminalInstance.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts index e22c8d14b42..1824f9b6695 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts @@ -1060,6 +1060,11 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { this._wrapperElement.classList.toggle('active', visible); } if (visible && this._xterm && this._xtermCore) { + // Resize to re-evaluate dimensions, this will ensure when switching to a terminal it is + // using the most up to date dimensions (eg. when terminal is created in the background + // using cached dimensions of a split terminal). + this._resize(); + // Trigger a manual scroll event which will sync the viewport and scroll bar. This is // necessary if the number of rows in the terminal has decreased while it was in the // background since scrollTop changes take no effect but the terminal's position does |