fix(shutdown): use KillSessionWithProcesses to prevent orphans

Address review feedback: revert KillSession back to KillSessionWithProcesses
in stopSession() to properly terminate all child processes.

KillSessionWithProcesses recursively finds and terminates descendant processes
with SIGTERM/SIGKILL, preventing orphaned Claude/node processes that can
survive tmux session kills.

The orphan detection in verifyShutdown() remains as a helpful warning but
shouldn't replace proper process termination.
This commit is contained in:
mayor
2026-01-17 18:26:19 +01:00
committed by Daniel Sauer
parent 65c1fad8ce
commit d2f7dbd3ae

View File

@@ -393,8 +393,8 @@ func stopSession(t *tmux.Tmux, sessionName string) (bool, error) {
time.Sleep(100 * time.Millisecond)
}
// Kill the session
return true, t.KillSession(sessionName)
// Kill the session (with explicit process termination to prevent orphans)
return true, t.KillSessionWithProcesses(sessionName)
}
// acquireShutdownLock prevents concurrent shutdowns.