From 35d26f1d271b226d03e37faf4628e22ca6899f55 Mon Sep 17 00:00:00 2001 From: irokas Date: Sun, 2 Jul 2017 14:22:24 +0300 Subject: [PATCH] Fix issue with small scrollback value. Closes #506 --- src/xterm.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/xterm.js b/src/xterm.js index 743ae7c..f81085e 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -419,6 +419,15 @@ Terminal.prototype.setOption = function(key, value) { } switch (key) { 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.lines.length > value) { const amountToTrim = this.lines.length - value;