Support buffers with scrollback of 0, force alt as 0

Fixes #802
This commit is contained in:
Daniel Imms
2017-08-06 18:18:49 -07:00
parent 27f7679494
commit a57f55dcbf
5 changed files with 68 additions and 51 deletions
+17 -1
View File
@@ -20,7 +20,7 @@ describe('Buffer', () => {
terminal.cols = INIT_COLS;
terminal.rows = INIT_ROWS;
terminal.options.scrollback = 1000;
buffer = new Buffer(terminal);
buffer = new Buffer(terminal, false);
});
describe('constructor', () => {
@@ -145,4 +145,20 @@ describe('Buffer', () => {
});
});
});
describe('alt buffer', () => {
it('should always have a scrollback of 0', () => {
assert.equal(terminal.options.scrollback, 1000);
// Test size on initialization
buffer = new Buffer(terminal, true);
buffer.fillViewportRows();
assert.equal(buffer.lines.maxLength, INIT_ROWS);
// Test size on buffer increase
buffer.resize(INIT_COLS, INIT_ROWS * 2);
assert.equal(buffer.lines.maxLength, INIT_ROWS * 2);
// Test size on buffer decrease
buffer.resize(INIT_COLS, INIT_ROWS / 2);
assert.equal(buffer.lines.maxLength, INIT_ROWS / 2);
});
});
});