Merge pull request #912 from Tyriar/911_negative_scrollback

Prevent scrollback setOption < 0
This commit is contained in:
Daniel Imms
2017-08-22 10:54:12 -07:00
committed by GitHub
+4
View File
@@ -454,6 +454,10 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
}
break;
case 'scrollback':
if (value < 0) {
console.warn(`scrollback cannot be less than 0, value: ${value}`);
return;
}
if (this.options[key] !== value) {
const newBufferLength = this.rows + value;
if (this.buffer.lines.length > newBufferLength) {