Skip to content

Commit 3b01dd2

Browse files
authored
fix(hub): keep shim dir off the child cwd so Windows cleanup can rmdir (#409)
1 parent e2460c5 commit 3b01dd2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/hub/src/node/__tests__/host-terminals.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,10 @@ describe.runIf(process.platform === 'win32')('devframeTerminalHost child-process
421421
writeFileSync(join(dir, 'child.cjs'), 'console.log("pid:" + process.pid); setInterval(() => {}, 1000)\n')
422422
const shim = join(dir, 'child.cmd')
423423
writeFileSync(shim, `@"${NODE}" "%~dp0\\child.cjs" %*\r\n`)
424-
const session = await host.startChildProcess({ command: shim, args: [], cwd: dir }, { id, title: id })
424+
// The shim resolves `child.cjs` via `%~dp0`, so it needs no cwd of its own.
425+
// Running out of `dir` would make Windows hold it as a working directory and
426+
// fail the later `rmdir` with EBUSY, so keep the shim's dir off the cwd.
427+
const session = await host.startChildProcess({ command: shim, args: [], cwd: tmpdir() }, { id, title: id })
425428
let pid = 0
426429
await waitUntil(() => {
427430
const match = session.buffer?.join('').match(/pid:(\d+)/)

0 commit comments

Comments
 (0)