]> git.proxmox.com Git - mirror_xterm.js.git/commitdiff
[issue #164] Fix bug that can occur when setting a scroll region
authorLucian Buzzo <lucian.buzzo@gmail.com>
Fri, 27 Jan 2017 11:25:12 +0000 (11:25 +0000)
committerLucian Buzzo <lucian.buzzo@gmail.com>
Fri, 27 Jan 2017 11:25:12 +0000 (11:25 +0000)
src/InputHandler.ts

index 4b96004e816636d943d7b3687ef65a1f196185aa..55fb13ca1349fb4191b219f494e21502c2ad2836 100644 (file)
@@ -1446,7 +1446,7 @@ export class InputHandler implements IInputHandler {
   public setScrollRegion(params: number[]): void {
     if (this._terminal.prefix) return;
     this._terminal.scrollTop = (params[0] || 1) - 1;
-    this._terminal.scrollBottom = (params[1] || this._terminal.rows) - 1;
+    this._terminal.scrollBottom = (params[1] && params[1] <= this._terminal.rows ? params[1] : this._terminal.rows) - 1;
     this._terminal.x = 0;
     this._terminal.y = 0;
   }