]> git.proxmox.com Git - mirror_xterm.js.git/blob - src/Buffer.ts
78882b7147c8aaf1bff05ab86c7bfb99282b581d
[mirror_xterm.js.git] / src / Buffer.ts
1 /**
2 * @license MIT
3 */
4
5 import { ITerminal } from './Interfaces';
6 import { CircularList } from './utils/CircularList';
7
8 /**
9 * This class represents a terminal buffer (an internal state of the terminal)/
10 */
11 export class Buffer {
12 public lines: CircularList<any>;
13 private _tabs: any;
14
15 /**
16 * Create a new Buffer.
17 * @param {Terminal} terminal - The terminal the buffer will belong to
18 * @param {number} ydisp - The scroll position of the buffer in the viewport
19 * @param {number} ybase - The scroll position of the y cursor (ybase + y = the y position within the buffer)
20 * @param {number} y - The cursor's y position after ybase
21 * @param {number} x - The cursor's x position after ybase
22 */
23 constructor(
24 private terminal: ITerminal,
25 public ydisp: number = 0,
26 public ybase: number = 0,
27 public y: number = 0,
28 public x: number = 0,
29 ) {
30 this.lines = new CircularList(this.terminal.scrollback);
31 }
32 }