MCPcopy Create free account
hub / github.com/Noumena-Network/code / runRenderedDiffCapture

Function runRenderedDiffCapture

src/ink/tmuxResetSequence.test.ts:158–176  ·  view source on GitHub ↗
(diff: Diff, name: string)

Source from the content-addressed store, hash-verified

156}
157
158async 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
178async function waitForFile(path: string, timeoutMs = 2000): Promise<void> {
179 const deadline = Date.now() + timeoutMs

Callers 1

Calls 6

rmSyncFunction · 0.90
buildResetScriptFunction · 0.85
capturePaneFunction · 0.85
sleepMethod · 0.80
serializeDiffFunction · 0.70

Tested by

no test coverage detected