From 2e562b59b61e8a46b63a36f79c2eb699e393783c Mon Sep 17 00:00:00 2001 From: "Anthony Fu (via agent)" Date: Fri, 25 Sep 2026 02:50:22 +0000 Subject: [PATCH] fix(hub): keep shim dir off the child cwd so Windows cleanup can rmdir --- packages/hub/src/node/__tests__/host-terminals.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/hub/src/node/__tests__/host-terminals.test.ts b/packages/hub/src/node/__tests__/host-terminals.test.ts index 97debcf1..18434d83 100644 --- a/packages/hub/src/node/__tests__/host-terminals.test.ts +++ b/packages/hub/src/node/__tests__/host-terminals.test.ts @@ -421,7 +421,10 @@ describe.runIf(process.platform === 'win32')('devframeTerminalHost child-process writeFileSync(join(dir, 'child.cjs'), 'console.log("pid:" + process.pid); setInterval(() => {}, 1000)\n') const shim = join(dir, 'child.cmd') writeFileSync(shim, `@"${NODE}" "%~dp0\\child.cjs" %*\r\n`) - const session = await host.startChildProcess({ command: shim, args: [], cwd: dir }, { id, title: id }) + // The shim resolves `child.cjs` via `%~dp0`, so it needs no cwd of its own. + // Running out of `dir` would make Windows hold it as a working directory and + // fail the later `rmdir` with EBUSY, so keep the shim's dir off the cwd. + const session = await host.startChildProcess({ command: shim, args: [], cwd: tmpdir() }, { id, title: id }) let pid = 0 await waitUntil(() => { const match = session.buffer?.join('').match(/pid:(\d+)/)