5 import { ITerminal } from './Interfaces';
6 import { Buffer } from './Buffer';
7 import { EventEmitter } from './EventEmitter';
9 export class BufferSet extends EventEmitter {
10 private _normal: Buffer;
12 private _activeBuffer: Buffer;
14 constructor(private _terminal: ITerminal) {
16 this._normal = new Buffer(this._terminal);
17 this._alt = new Buffer(this._terminal);
18 this._activeBuffer = this._normal;
21 public get alt(): Buffer {
25 public get active(): Buffer {
26 return this._activeBuffer;
29 public get normal(): Buffer {
33 private resetTerminal() {
34 this._terminal.reset();
35 this._terminal.viewport.syncScrollArea();
36 this._terminal.showCursor();
39 public activateNormalBuffer(): void {
40 this._activeBuffer = this._normal;
42 this.emit('activate', this._normal);
45 public activateAltBuffer(): void {
46 this._activeBuffer = this._alt;
48 this.emit('activate', this._alt);