mirror of
https://git.proxmox.com/git/mirror_xterm.js
synced 2025-10-25 20:26:43 +00:00
Merge pull request #436 from Tyriar/434_tmux_scroll_fix
Fix scroll in tmux with max scrollback
This commit is contained in:
commit
cabe23b782
16
src/xterm.js
16
src/xterm.js
@ -1252,6 +1252,15 @@ Terminal.prototype.showCursor = function() {
|
||||
Terminal.prototype.scroll = function() {
|
||||
var row;
|
||||
|
||||
// Make room for the new row in lines
|
||||
if (this.lines.length === this.lines.maxLength) {
|
||||
this.lines.trimStart(1);
|
||||
this.ybase--;
|
||||
if (this.ydisp !== 0) {
|
||||
this.ydisp--;
|
||||
}
|
||||
}
|
||||
|
||||
this.ybase++;
|
||||
|
||||
// TODO: Why is this done twice?
|
||||
@ -1266,13 +1275,6 @@ Terminal.prototype.scroll = function() {
|
||||
row -= this.rows - 1 - this.scrollBottom;
|
||||
|
||||
if (row === this.lines.length) {
|
||||
// Compensate ybase and ydisp if lines has hit the maximum buffer size
|
||||
if (this.lines.length === this.lines.maxLength) {
|
||||
this.ybase--;
|
||||
if (this.ydisp !== 0) {
|
||||
this.ydisp--;
|
||||
}
|
||||
}
|
||||
// Optimization: pushing is faster than splicing when they amount to the same behavior
|
||||
this.lines.push(this.blankLine());
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user