Fix issue with small scrollback value.

Closes #506
This commit is contained in:
irokas 2017-07-02 14:22:24 +03:00
parent 0b3d1e50a8
commit 35d26f1d27

View File

@ -419,6 +419,15 @@ Terminal.prototype.setOption = function(key, value) {
} }
switch (key) { switch (key) {
case 'scrollback': case 'scrollback':
if (value < this.rows) {
let msg = 'Setting the scrollback value less than the number of rows ';
msg += `(${this.rows}) is not allowed.`;
console.warn(msg);
return false;
}
if (this.options[key] !== value) { if (this.options[key] !== value) {
if (this.lines.length > value) { if (this.lines.length > value) {
const amountToTrim = this.lines.length - value; const amountToTrim = this.lines.length - value;