(diff: Diff, name: string)
| 156 | } |
| 157 | |
| 158 | async function runRenderedDiffCapture(diff: Diff, name: string): Promise<string> { |
| 159 | const tmpDir = mkdtempSync(join(tmpdir(), 'code-tmux-rendered-reset-')) |
| 160 | try { |
| 161 | const sequencePath = join(tmpDir, `${name}.seq`) |
| 162 | writeFileSync(sequencePath, serializeDiff(diff)) |
| 163 | |
| 164 | const session = createIsolatedTmuxSession({ |
| 165 | command: buildResetScript(sequencePath), |
| 166 | width: 80, |
| 167 | height: 10, |
| 168 | }) |
| 169 | liveSessions.push(session) |
| 170 | |
| 171 | await Bun.sleep(200) |
| 172 | return capturePane(session, { startLine: -80 }) |
| 173 | } finally { |
| 174 | rmSync(tmpDir, { recursive: true, force: true }) |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | async function waitForFile(path: string, timeoutMs = 2000): Promise<void> { |
| 179 | const deadline = Date.now() + timeoutMs |
no test coverage detected