fix(tmux): use KillSessionWithProcesses to prevent zombie bash processes
When Claude sessions were terminated using KillSession(), bash subprocesses spawned by Claude's Bash tool could survive because they ignore SIGHUP. This caused zombie processes to accumulate over time. Changed all critical session termination paths to use KillSessionWithProcesses() which explicitly kills all descendant processes before terminating the session. Fixes: gt-ew3tk Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -68,8 +68,9 @@ func stopTownSessionInternal(t *tmux.Tmux, ts TownSession, force bool) (bool, er
|
||||
_ = events.LogFeed(events.TypeSessionDeath, ts.SessionID,
|
||||
events.SessionDeathPayload(ts.SessionID, ts.Name, reason, "gt down"))
|
||||
|
||||
// Kill the session
|
||||
if err := t.KillSession(ts.SessionID); err != nil {
|
||||
// Kill the session.
|
||||
// Use KillSessionWithProcesses to ensure all descendant processes are killed.
|
||||
if err := t.KillSessionWithProcesses(ts.SessionID); err != nil {
|
||||
return false, fmt.Errorf("killing %s session: %w", ts.Name, err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user