fix: use build tags for Setpgid (Unix-only) to fix Windows build

This commit is contained in:
2026-05-26 14:46:36 +01:00
parent a81482d06a
commit a5b18140d3
3 changed files with 22 additions and 1 deletions
+1 -1
View File
@@ -334,7 +334,7 @@ func ensureWorkerRunningCtx(ctx context.Context) (int, error) {
// Start worker -- detach from hook's process group so Claude Code
// killing the hook doesn't take the worker down with it.
cmd := exec.Command(workerPath) // #nosec G204 -- workerPath is from internal findWorkerBinary
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
setSysProcAttr(cmd)
cmd.Stdout = os.Stderr
cmd.Stderr = os.Stderr
if err := cmd.Start(); err != nil {