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