Skip to content

Commit

Permalink
Merge pull request #98015 from jeanp413/fix-97927
Browse files Browse the repository at this point in the history
Fixes terminal Env Variables Icon Not Updating Position
  • Loading branch information
Tyriar committed Jun 11, 2020
2 parents 145d6bf + fd1a0ac commit dcc0c13
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -103,6 +103,8 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
private _commandTrackerAddon: CommandTrackerAddon | undefined;
private _navigationModeAddon: INavigationMode & ITerminalAddon | undefined;

private _timeoutDimension: dom.Dimension | undefined;

public disableLayout: boolean;
public get id(): number { return this._id; }
public get cols(): number {
Expand Down Expand Up @@ -821,7 +823,8 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
// HACK: Trigger another async layout to ensure xterm's CharMeasure is ready to use,
// this hack can be removed when https://github.com/xtermjs/xterm.js/issues/702 is
// supported.
setTimeout(() => this.layout(new dom.Dimension(width, height)), 0);
this._timeoutDimension = new dom.Dimension(width, height);
setTimeout(() => this.layout(this._timeoutDimension!), 0);
}
}
}
Expand Down Expand Up @@ -1269,6 +1272,8 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
return;
}

this._timeoutDimension = new dom.Dimension(dimension.width, dimension.height);

if (this._xterm && this._xterm.element) {
this._xterm.element.style.width = terminalWidth + 'px';
}
Expand Down

0 comments on commit dcc0c13

Please sign in to comment.