diff --git a/static/js/terminal/lib/csi/scroll.js b/static/js/terminal/lib/csi/scroll.js index 8195e62..1d5c151 100644 --- a/static/js/terminal/lib/csi/scroll.js +++ b/static/js/terminal/lib/csi/scroll.js @@ -13,7 +13,7 @@ module.exports = function (Terminal){ this.lines.splice(this.ybase + this.scrollTop, 1); this.lines.splice(this.ybase + this.scrollBottom, 0, this.blankLine()); } - + this.updateRange(this.scrollTop); this.updateRange(this.scrollBottom); }; @@ -30,4 +30,17 @@ module.exports = function (Terminal){ this.updateRange(this.scrollTop); this.updateRange(this.scrollBottom); }; + + // CSI Ps ; Ps r + // Set Scrolling Region [top;bottom] (default = full size of win- + // dow) (DECSTBM). + // CSI ? Pm r + Terminal.prototype.setScrollRegion = function (params){ + if (this.prefix) return; + + this.x = 0; + this.y = 0; + this.scrollTop = (params[0] || 1) - 1; + this.scrollBottom = (params[1] || this.rows) - 1; + }; }; diff --git a/static/js/terminal/lib/write.js b/static/js/terminal/lib/write.js index 2d9281c..24969e3 100644 --- a/static/js/terminal/lib/write.js +++ b/static/js/terminal/lib/write.js @@ -651,7 +651,7 @@ module.exports = function (Terminal){ // dow) (DECSTBM). // CSI ? Pm r case 'r': - //- this.setScrollRegion(this.params); + this.setScrollRegion(this.params); break; // CSI s // Save cursor (ANSI.SYS).