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:
@@ -430,9 +430,10 @@ func (d *Daemon) checkDeaconHeartbeat() {
|
||||
|
||||
// Session exists but heartbeat is stale - Deacon is stuck
|
||||
if age > 30*time.Minute {
|
||||
// Very stuck - restart the session
|
||||
// Very stuck - restart the session.
|
||||
// Use KillSessionWithProcesses to ensure all descendant processes are killed.
|
||||
d.logger.Printf("Deacon stuck for %s - restarting session", age.Round(time.Minute))
|
||||
if err := d.tmux.KillSession(sessionName); err != nil {
|
||||
if err := d.tmux.KillSessionWithProcesses(sessionName); err != nil {
|
||||
d.logger.Printf("Error killing stuck Deacon: %v", err)
|
||||
}
|
||||
// ensureDeaconRunning will restart on next heartbeat
|
||||
|
||||
Reference in New Issue
Block a user