From b2522cd28301eb7e572dfc717295846289ba860a Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Tue, 3 Dec 2019 12:26:34 -0800 Subject: [PATCH] Fixed bug where _read() was defined after stream creation --- modules/win-virtual-terminal.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/win-virtual-terminal.js b/modules/win-virtual-terminal.js index 4907815..883d207 100644 --- a/modules/win-virtual-terminal.js +++ b/modules/win-virtual-terminal.js @@ -115,18 +115,18 @@ function vt() ds.terminal = ret; ds._rpbuf = GM.CreateVariable(4096); ds._rpbufRead = GM.CreateVariable(4); - ds._read = function _read() + ds.__read = function __read() { - this._rp = this.terminal.k32.ReadFile.async(this.terminal._output.Deref(), this._rpbuf, this._rpbuf._size, this._rpbufRead, 0); + this._rp = this.terminal.k32.ReadFile.async(this.terminal._output.Deref(), this._rpbuf, this._rpbuf._size, this._rpbufRead, 0); this._rp.then(function () { var len = this.parent._rpbufRead.toBuffer().readUInt32LE(); this.parent.push(this.parent._rpbuf.toBuffer().slice(0, len)); - this.parent._read(); + this.parent.__read(); }); this._rp.parent = this; }; - ds._read(); + ds.__read(); return (ds); } else