diff --git a/src/Buffer.ts b/src/Buffer.ts index 32a406a6..78882b71 100644 --- a/src/Buffer.ts +++ b/src/Buffer.ts @@ -9,7 +9,7 @@ import { CircularList } from './utils/CircularList'; * This class represents a terminal buffer (an internal state of the terminal)/ */ export class Buffer { - private _lines: CircularList; + public lines: CircularList; private _tabs: any; /** @@ -27,10 +27,6 @@ export class Buffer { public y: number = 0, public x: number = 0, ) { - this._lines = new CircularList(this.terminal.scrollback); - } - - public get lines(): CircularList { - return this._lines; + this.lines = new CircularList(this.terminal.scrollback); } } diff --git a/src/Parser.ts b/src/Parser.ts index 00d574ee..2bb635d8 100644 --- a/src/Parser.ts +++ b/src/Parser.ts @@ -52,7 +52,7 @@ escapedStateHandler['c'] = (parser, terminal) => { }; escapedStateHandler['E'] = (parser, terminal) => { // ESC E Next Line ( NEL is 0x85). - terminal.x = 0; + terminal.buffer.x = 0; terminal.index(); parser.setState(ParserState.NORMAL); }; diff --git a/src/Renderer.ts b/src/Renderer.ts index 236b70d1..db4d6a63 100644 --- a/src/Renderer.ts +++ b/src/Renderer.ts @@ -144,10 +144,10 @@ export class Renderer { let line = this._terminal.buffer.lines.get(row); let x; - if (this._terminal.y === y - (this._terminal.buffer.ybase - this._terminal.buffer.ydisp) && + if (this._terminal.buffer.y === y - (this._terminal.buffer.ybase - this._terminal.buffer.ydisp) && this._terminal.cursorState && !this._terminal.cursorHidden) { - x = this._terminal.x; + x = this._terminal.buffer.x; } else { x = -1; }