constructor(xterm: Terminal) { this.xterm = xterm; this._termSize = { cols: this.xterm.cols, rows: this.xterm.rows }; this._promptPrefix = ""; this._continuationPromptPrefix = ""; this._input = ""; this._cursor = 0; }
/** * Prints a message and properly handles new-lines */ print(message: string, sync?: boolean) { const normInput = message.replace(/[\r\n]+/g, "\n").replace(/\n/g, "\r\n"); if (sync) { // We write it synchronously via hacking a bit on xterm //@ts-ignore this.xterm._core.writeSync(normInput); //@ts-ignore this.xterm._core._renderService._renderer._runOperation(renderer => renderer.onGridChanged(0, this.xterm.rows - 1) ); } else { //@ts-ignore this.xterm.write(normInput); } }
constructor(xterm: Terminal) { this.xterm = xterm; this._termSize = { cols: this.xterm.cols, rows: this.xterm.rows }; this._promptPrefix = ""; this._continuationPromptPrefix = ""; this._input = ""; this._cursor = 0; }
/** * Prints a message and properly handles new-lines */ print(message: string, sync?: boolean) { const normInput = message.replace(/[\r\n]+/g, "\n").replace(/\n/g, "\r\n"); if (sync) { // We write it synchronously via hacking a bit on xterm //@ts-ignore this.xterm._core.writeSync(normInput); //@ts-ignore this.xterm._core._renderService._renderer._runOperation(renderer => renderer.onGridChanged(0, this.xterm.rows - 1) ); } else { //@ts-ignore this.xterm.write(normInput); } }