Skip to content

Commit

Permalink
Relayout terminals when they are set to visible
Browse files Browse the repository at this point in the history
This fixes an issue where background terminals were created while not
visible. This caused the internal charMeasure object to have 0 width and
height so nothing would render.

Fixes #34554
  • Loading branch information
Tyriar committed Oct 12, 2017
1 parent ed9fe0c commit b4de6e8
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,14 @@ export class TerminalInstance implements ITerminalInstance {
// background since scrollTop changes take no effect but the terminal's position does
// change since the number of visible rows decreases.
this._xterm.emit('scroll', this._xterm.buffer.ydisp);
// Force a layout when the instance becomes invisible. This is particularly important
// for ensuring that terminals that are created in the background by an extension will
// correctly get correct character measurements in order to render to the screen (see
// #34554).
const computedStyle = window.getComputedStyle(this._container);

This comment has been minimized.

Copy link
@bpasero

bpasero Oct 13, 2017

Member
const width = parseInt(computedStyle.getPropertyValue('width').replace('px', ''), 10);
const height = parseInt(computedStyle.getPropertyValue('height').replace('px', ''), 10);
this.layout(new Dimension(width, height));
}
}

Expand Down

0 comments on commit b4de6e8

Please sign in to comment.