(line: string, timeoutMs: number)
| 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"); |
| 81 | const snapshot = await term.screen.waitUntil( |
| 82 | (current) => outputAfter(current.text, line) !== null, |
| 83 | { timeoutMs }, |
| 84 | ); |
| 85 | return outputAfter(snapshot.text, line) ?? ""; |
| 86 | }; |
| 87 | |
| 88 | // Blocks until the browser fiber completes consent → OpenCode's |
| 89 | // callback receives the code → OpenCode stores the grant. |
no test coverage detected