From cc5ae8193b14171375e27e5b8cb320ed7d031cdc Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sat, 24 Dec 2016 00:26:43 -0800 Subject: [PATCH] Fix insertLines as max buffer size --- src/xterm.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/xterm.js b/src/xterm.js index 933a9e10..8ede46ed 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -3086,7 +3086,7 @@ Terminal.prototype.eraseLine = function(y) { /** - * Return the data array of a blank line/ + * Return the data array of a blank line * @param {number} cur First bunch of data for each "blank" character. */ Terminal.prototype.blankLine = function(cur) { @@ -3706,12 +3706,11 @@ Terminal.prototype.insertLines = function(params) { while (param--) { if (this.lines.length === this.lines.maxLength) { - // Trim the start of lines to make room for the new temporary row - // TODO: This section could be optimized by introducing a CircularList function that inserts, - // deletes and shifts elements to accomplish this task. this.lines.trimStart(1); - this.ybase -= 1; - this.ydisp -= 1; + this.ybase--; + this.ydisp--; + row--; + j--; } // test: echo -e '\e[44m\e[1L\e[0m' // blankLine(true) - xterm/linux behavior