(buf: Buffer)
| 100 | } |
| 101 | |
| 102 | private writeNonBinary(buf: Buffer) { |
| 103 | let start = 0; |
| 104 | let time = ''; |
| 105 | if (this.options.timestamp) { |
| 106 | time = this.hrTimer.createDateTimestamp() + ' '; |
| 107 | } |
| 108 | |
| 109 | for (let ix = 1; ix < buf.length; ix++ ) { |
| 110 | if (buf[ix - 1] !== 0xff) { continue; } |
| 111 | const chr = buf[ix]; |
| 112 | if (((chr >= 48) && (chr <= 57)) || ((chr >= 65) && (chr <= 90))) { |
| 113 | if (ix >= 1) { |
| 114 | this.ptyTerm.writeWithHeader(buf.slice(start, ix - 1), time); |
| 115 | } |
| 116 | this.ptyTerm.write(`<switch to vTerm#${String.fromCharCode(chr)}>\n`); |
| 117 | buf = buf.slice(ix + 1); |
| 118 | ix = 0; |
| 119 | start = 0; |
| 120 | } |
| 121 | } |
| 122 | if (buf.length > 0) { |
| 123 | this.ptyTerm.writeWithHeader(buf, time); |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | protected createTermOptions(existing: string | null): IPtyTerminalOptions { |
| 128 | const ret: IPtyTerminalOptions = { |
no test coverage detected