Documentation
¶
Overview ¶
Package proc handles process-group lifecycle for the monitored Codex child.
Codex spawns its own shell commands (e.g. /bin/zsh -lc 'go test'), so killing only the codex PID would orphan those children. We therefore launch codex in its own process group and signal the whole group.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KillGroupNow ¶
func KillGroupNow(pid int)
KillGroupNow sends an immediate SIGKILL to the whole process group led by pid. Use for timeout cancellation where a graceful SIGTERM grace is not worth waiting for.
func SetChildGroup ¶
SetChildGroup configures cmd so the child becomes the leader of a fresh process group, letting us signal it and all of its descendants together.
It also pins Stdin: if the caller leaves cmd.Stdin nil, exec connects the child to /dev/null, which is exactly what we want — a piped, never-closing stdin is the classic cause of `codex exec` hanging on "Reading additional input from stdin...".
func SetDetached ¶
SetDetached configures cmd to survive its launcher: a new session means the process is reparented to init and is unaffected when the spawning shell (and the Claude Bash tool that ran it) exits.
func TerminateGroup ¶
TerminateGroup asks the process group led by pid to stop: SIGTERM first, then SIGKILL after grace if anything is still alive. The negative pid targets the whole group. It is safe to call on a dead process.
Types ¶
This section is empty.