zot/internal/agent/botcmd_unix.go
patriceckhart 682c64f494 fix ci on windows: split detach helper into posix/windows variants
syscall.SysProcAttr.Setsid is posix-only — unknown field on windows.
Extracted the detach-on-start logic into a detachChild function
variable, implemented in botcmd_unix.go (Setsid) and botcmd_windows.go
(DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP creation flags).
2026-04-18 10:58:10 +02:00

17 lines
361 B
Go

//go:build !windows
package agent
import (
"os/exec"
"syscall"
)
// detachChild runs the bot in a new session so tty signals sent to
// the parent shell (SIGINT when the terminal closes, SIGHUP on
// logout) don't propagate to the detached bot.
func init() {
detachChild = func(cmd *exec.Cmd) {
cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true}
}
}