Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback to 80x30 dimensions in terminal #128700

Merged
merged 2 commits into from
Jul 14, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
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
Tyriar committed Jul 14, 2021
commit 5e159d1b9005a9041109a10fad0504518c75db07
5 changes: 5 additions & 0 deletions src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
Original file line number Diff line number Diff line change
@@ -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