Merge pull request #978 from Tyriar/953_user_scrolling_fix

Improve scrolling while user has scrolled up
This commit is contained in:
Daniel Imms
2017-09-14 09:01:13 -07:00
committed by GitHub
+10 -1
View File
@@ -1072,7 +1072,16 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
// Only adjust ybase and ydisp when the buffer is not trimmed
if (!willBufferBeTrimmed) {
this.buffer.ybase++;
this.buffer.ydisp++;
// Only scroll the ydisp with ybase if the user has not scrolled up
if (!this.userScrolling) {
this.buffer.ydisp++;
}
} else {
// When the buffer is full and the user has scrolled up, keep the text
// stable unless ydisp is right at the top
if (this.userScrolling) {
this.buffer.ydisp = Math.max(this.buffer.ydisp - 1, 0);
}
}
} else {
// scrollTop is non-zero which means no line will be going to the