diff --git a/src/xterm.js b/src/xterm.js index dc3b940b..ab9c5320 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -1237,12 +1237,12 @@ Terminal.prototype.scrollDisp = function(disp, suppressScrollEvent) { this.userScrolling = false; } - this.ydisp += disp; + const oldYdisp = this.ydisp; + this.ydisp = Math.max(Math.min(this.ydisp + disp, this.ybase), 0); - if (this.ydisp > this.ybase) { - this.ydisp = this.ybase; - } else if (this.ydisp < 0) { - this.ydisp = 0; + // No change occurred, don't trigger scroll/refresh + if (oldYdisp === this.ydisp) { + return; } if (!suppressScrollEvent) {