5 import { ITerminal } from './Interfaces';
6 import { CircularList } from './utils/CircularList';
9 * This class represents a terminal buffer (an internal state of the terminal)/
12 public lines: CircularList<string>;
15 * Create a new Buffer.
16 * @param {Terminal} terminal - The terminal the buffer will belong to
17 * @param {number} ydisp - The scroll position of the buffer in the viewport
18 * @param {number} ybase - The scroll position of the y cursor (ybase + y = the y position within the buffer)
19 * @param {number} y - The cursor's y position after ybase
20 * @param {number} x - The cursor's x position after ybase
23 private terminal: ITerminal,
24 public ydisp: number = 0,
25 public ybase: number = 0,
28 public scrollBottom: number = 0,
29 public scrollTop: number = 0,
30 public tabs: any = {},
32 this.lines = new CircularList<string>(this.terminal.scrollback);
33 this.scrollBottom = this.terminal.rows - 1;