(text: string, line: string)
| 71 | await term.screen.waitForText("$", { timeoutMs: 10_000 }); |
| 72 | |
| 73 | const outputAfter = (text: string, line: string): string | null => { |
| 74 | const echoed = text.lastIndexOf(line); |
| 75 | if (echoed === -1) return null; |
| 76 | const after = text.slice(echoed + line.length); |
| 77 | return after.trimEnd().endsWith("\n$") ? after : null; |
| 78 | }; |
| 79 | const sh = async (line: string, timeoutMs: number) => { |
| 80 | await term.keyboard.type(line); |
| 81 | await term.keyboard.press("Enter"); |