fix(#466): add detached: true to SessionStart hook spawn for Windows

On Windows, child.unref() alone is insufficient for proper process
detachment. The child process remains in the parent's process group,
causing Claude Code to wait for the hook process tree to exit before
accepting input.

Adding detached: true allows the child process to fully detach on
Windows while maintaining existing behavior on Unix.

Closes #466

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson
2026-02-08 09:55:21 -06:00
parent ced41d771b
commit 1344bd8f18

View File

@@ -55,7 +55,8 @@ const child = spawn(process.execPath, ['-e', `
fs.writeFileSync(cacheFile, JSON.stringify(result));
`], {
stdio: 'ignore',
windowsHide: true
windowsHide: true,
detached: true // Required on Windows for proper process detachment
});
child.unref();