fix(orphan): prevent Claude Code session leaks on macOS
Three bugs were causing orphaned Claude processes to accumulate: 1. TTY comparison in orphan.go checked for "?" but macOS shows "??" - Orphan cleanup never found anything on macOS - Changed to check for both "?" and "??" 2. selfKillSession in done.go used basic tmux kill-session - Claude Code can survive SIGHUP - Now uses KillSessionWithProcesses for proper cleanup 3. Crew stop commands used basic KillSession - Same issue as #2 - Updated runCrewRemove, runCrewStop, runCrewStopAll Root cause of 383 accumulated sessions: every gt done and crew stop left orphans, and the cleanup never worked on macOS. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -191,7 +191,8 @@ func FindOrphanedClaudeProcesses() ([]OrphanedProcess, error) {
|
||||
etimeStr := fields[3]
|
||||
|
||||
// Only look for claude/codex processes without a TTY
|
||||
if tty != "?" {
|
||||
// Linux shows "?" for no TTY, macOS shows "??"
|
||||
if tty != "?" && tty != "??" {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user