diff --git a/src/xterm.js b/src/xterm.js index e26288c..88096df 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -375,14 +375,19 @@ */ Viewport.prototype.syncScrollArea = function() { if (this.isApplicationMode) { + // Fix scroll bar in application mode this.lastRecordedBufferLength = this.terminal.rows; this.refresh(); return; } if (this.lastRecordedBufferLength !== this.terminal.lines.length) { + // If buffer height changed this.lastRecordedBufferLength = this.terminal.lines.length; this.refresh(); + } else if (this.lastRecordedViewportHeight !== this.terminal.rows) { + // If viewport height changed + this.refresh(); } else { // If size has changed, refresh viewport var size = this.charMeasureElement.getBoundingClientRect(); @@ -390,6 +395,8 @@ this.refresh(size); } } + + // Sync scrollTop var scrollTop = this.terminal.ydisp * this.currentRowHeight; if (this.viewportElement.scrollTop !== scrollTop) { this.viewportElement.scrollTop = scrollTop;