Skip to content

Commit 5e159d1

Browse files
committed
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
1 parent 3bea1f0 commit 5e159d1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/vs/workbench/contrib/terminal/browser/terminalInstance.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,11 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
10601060
this._wrapperElement.classList.toggle('active', visible);
10611061
}
10621062
if (visible && this._xterm && this._xtermCore) {
1063+
// Resize to re-evaluate dimensions, this will ensure when switching to a terminal it is
1064+
// using the most up to date dimensions (eg. when terminal is created in the background
1065+
// using cached dimensions of a split terminal).
1066+
this._resize();
1067+
10631068
// Trigger a manual scroll event which will sync the viewport and scroll bar. This is
10641069
// necessary if the number of rows in the terminal has decreased while it was in the
10651070
// background since scrollTop changes take no effect but the terminal's position does

0 commit comments

Comments
 (0)