mirror of
https://github.com/nuintun/command-manager.git
synced 2025-06-07 19:44:35 +08:00
34 lines
883 B
JavaScript
34 lines
883 B
JavaScript
/**
|
|
* Created by nuintun on 2015/11/25.
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
module.exports = function (Terminal){
|
|
// CSI Ps S Scroll up Ps lines (default = 1) (SU).
|
|
Terminal.prototype.scrollUp = function (params){
|
|
var param = params[0] || 1;
|
|
|
|
while (param--) {
|
|
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);
|
|
};
|
|
|
|
// CSI Ps T Scroll down Ps lines (default = 1) (SD).
|
|
Terminal.prototype.scrollDown = function (params){
|
|
var param = params[0] || 1;
|
|
|
|
while (param--) {
|
|
this.lines.splice(this.ybase + this.scrollBottom, 1);
|
|
this.lines.splice(this.ybase + this.scrollTop, 0, this.blankLine());
|
|
}
|
|
|
|
this.updateRange(this.scrollTop);
|
|
this.updateRange(this.scrollBottom);
|
|
};
|
|
};
|