From a9e1ed5a72f23a53d681eaa8a939a88e24e26cbc Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 28 Dec 2016 03:41:12 -0800 Subject: [PATCH 1/2] Ensure ydisp does not drop below 0 in refresh Fixes #428 Related to #385 --- src/xterm.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/xterm.js b/src/xterm.js index a475b75f..700beafe 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -1077,6 +1077,7 @@ Terminal.prototype.refresh = function(start, end, queue) { } for (; y <= end; y++) { + console.log('this.ydisp: ' + this.ydisp); row = y + this.ydisp; line = this.lines.get(row); @@ -1251,7 +1252,9 @@ Terminal.prototype.scroll = function() { // Compensate ybase and ydisp if lines has hit the maximum buffer size if (this.lines.length === this.lines.maxLength) { this.ybase--; - this.ydisp--; + if (this.ydisp !== 0) { + this.ydisp--; + } } // Optimization: pushing is faster than splicing when they amount to the same behavior this.lines.push(this.blankLine()); From 5d29d4ea22b34799e6203a45d94a9d66b176df17 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 28 Dec 2016 03:41:48 -0800 Subject: [PATCH 2/2] Remove log --- src/xterm.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/xterm.js b/src/xterm.js index 700beafe..69bbc73a 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -1077,7 +1077,6 @@ Terminal.prototype.refresh = function(start, end, queue) { } for (; y <= end; y++) { - console.log('this.ydisp: ' + this.ydisp); row = y + this.ydisp; line = this.lines.get(row);