You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A session can be active (PID alive) and idle (hook status), but its parent terminal has been closed. CodeV shows it as green (idle), which is misleading — the user can't interact with it without reattaching.
How claude-control does it
Uses isOrphaned() — walks process tree (via ps -e) looking for known terminal apps (iTerm2, Terminal.app, Ghostty, etc.). If not found → ORPHANED. Checks every 30s. Uses ps process tree, not ~/.claude/sessions/*.json.
How CodeV can implement it
We already have the infra:
detectTerminalApp(pid) walks the process tree and returns 'iterm2', 'ghostty', 'cmux', 'terminal', or 'unknown'
Problem
A session can be active (PID alive) and idle (hook status), but its parent terminal has been closed. CodeV shows it as green (idle), which is misleading — the user can't interact with it without reattaching.
How claude-control does it
Uses
isOrphaned()— walks process tree (viaps -e) looking for known terminal apps (iTerm2, Terminal.app, Ghostty, etc.). If not found → ORPHANED. Checks every 30s. Usespsprocess tree, not~/.claude/sessions/*.json.How CodeV can implement it
We already have the infra:
detectTerminalApp(pid)walks the process tree and returns'iterm2','ghostty','cmux','terminal', or'unknown'~/.claude/sessions/*.json(PR feat: rewrite detection with sessions/ PID files + cross-ref fallback #67)Detection logic:
sessions/*.json):entrypoint !== 'cli')detectTerminalApp(pid)'unknown'→ session is orphanedWhen to check:
get-session-statusescall (startup + window focus)detectTerminalAppcalls already done for terminal badgesUI:
ORPHANEDimpliedEdge cases:
entrypoint: 'claude-vscode') — not orphaned even if no terminal found🤖 On behalf of @grimmerk — generated with Claude Code