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:
@@ -149,7 +149,8 @@ func (c *OrphanSessionCheck) Fix(ctx *CheckContext) error {
|
||||
// Log pre-death event for crash investigation (before killing)
|
||||
_ = events.LogFeed(events.TypeSessionDeath, sess,
|
||||
events.SessionDeathPayload(sess, "unknown", "orphan cleanup", "gt doctor"))
|
||||
if err := t.KillSession(sess); err != nil {
|
||||
// Use KillSessionWithProcesses to ensure all descendant processes are killed.
|
||||
if err := t.KillSessionWithProcesses(sess); err != nil {
|
||||
lastErr = err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user