( fixture: WrapperTmuxFixture, predicate: (rows: string[]) => boolean, timeoutMs = 2_000, )
| 23 | const liveFixtures: WrapperTmuxFixture[] = [] |
| 24 | |
| 25 | async function waitForPromptRows( |
| 26 | fixture: WrapperTmuxFixture, |
| 27 | predicate: (rows: string[]) => boolean, |
| 28 | timeoutMs = 2_000, |
| 29 | ): Promise<string | null> { |
| 30 | const deadline = Date.now() + timeoutMs |
| 31 | let pane = '' |
| 32 | while (Date.now() < deadline) { |
| 33 | pane = capturePane(fixture.session, { startLine: 0 }) |
| 34 | const promptRows = readVisibleRows(readPromptBand(pane, { rowsBelow: 3 })) |
| 35 | if (predicate(promptRows)) { |
| 36 | return pane |
| 37 | } |
| 38 | await Bun.sleep(50) |
| 39 | } |
| 40 | return null |
| 41 | } |
| 42 | |
| 43 | async function enterMultilinePrompt(fixture: WrapperTmuxFixture): Promise<string> { |
| 44 | let pane = '' |
no test coverage detected