(text: string, line: string)
| 234 | await term.screen.waitForText("$", { timeoutMs: 10_000 }); |
| 235 | |
| 236 | const outputAfter = (text: string, line: string): string | null => { |
| 237 | const echoed = text.lastIndexOf(line); |
| 238 | if (echoed === -1) return null; |
| 239 | const after = text.slice(echoed + line.length); |
| 240 | return after.trimEnd().endsWith("\n$") ? after : null; |
| 241 | }; |
| 242 | const sh = async (line: string, timeoutMs: number) => { |
| 243 | await term.keyboard.type(line); |
| 244 | await term.keyboard.press("Enter"); |