Skip to content

Commit

Permalink
Prevent scrollback setOption < 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Aug 21, 2017
1 parent abe3227 commit 877e1e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 877e1e5

Please sign in to comment.