Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Imms <2193314+Tyriar@users.noreply.github.com>2021-07-15 00:44:35 +0300
committerDaniel Imms <2193314+Tyriar@users.noreply.github.com>2021-07-15 00:44:35 +0300
commit5e159d1b9005a9041109a10fad0504518c75db07 (patch)
tree90597dfe20e9929f8a48ad3cf98ee2cb52b2da9d
parent3bea1f0db371a7c7e90a08725c442af3a75cdede (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.ts5
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