()
| 42 | } |
| 43 | |
| 44 | reflowInput() { |
| 45 | const cols = this.xterm.cols |
| 46 | const lines: string[][] = [] |
| 47 | |
| 48 | const inputChars = Array.from(this.input) |
| 49 | |
| 50 | const firstLine = inputChars.slice(0, cols - this.inputStartCursorX) |
| 51 | lines.push(firstLine) |
| 52 | let index = firstLine.length |
| 53 | let lastLineFull = firstLine.length === cols - this.inputStartCursorX |
| 54 | while (index < inputChars.length) { |
| 55 | const line = inputChars.slice(index, index + cols) |
| 56 | lines.push(line) |
| 57 | index += line.length |
| 58 | lastLineFull = line.length == cols |
| 59 | } |
| 60 | if (lastLineFull) { |
| 61 | lines.push(['']) |
| 62 | } |
| 63 | |
| 64 | // TODO: Redraw relevant lines |
| 65 | this.inputSplit = lines |
| 66 | } |
| 67 | |
| 68 | getInput(): string { |
| 69 | return this.input.join('') |
no outgoing calls
no test coverage detected