mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Merge pull request #912 from Tyriar/911_negative_scrollback
Prevent scrollback setOption < 0
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user