[Bug]: Agents running inside a user's tmux session are not detected/shown as running
@OrcaWin is already working on this.
Since Jul 20, 2026.
- Dominant language
- TypeScript
- Stars
- 72.1k
- Forks
- 4.7k
- Avg merge
- 14h 54m
- Merged PRs (30d)
- 520
Description
Summary
Orca does not identify running AI agents (e.g. claude, codex) when they run inside a user's tmux session. The agent never shows up as a live/running agent on the pane, worktree, or project view — the pane just reads as tmux.
Note: this is about live agent detection. The file-based Agent Session History (AI Vault, which scans ~/.claude/projects/**) still surfaces the transcript by cwd; only the live/running indicator is missing.
Root cause
Live foreground detection walks the process tree downward from the pane's shell pid and only inspects that subtree:
src/main/providers/agent-foreground-process.ts—collectDescendants(rows, shellPid)src/relay/pty-shell-utils.ts— the relay twin
When a user runs tmux in an Orca pane, the process in the pane is the tmux client. tmux daemonizes a server (double-fork, reparented to pid 1), and every pane process — including claude — is a child of that server, not of the pane's shell. So the descendant walk from the shell pid reaches only the tmux client (not a recognized agent) and never the agent. It falls back to the client name (tmux).
The OSC path (OSC 133 / OSC 9999 status sequences) also misses it, because tmux does not forward those to the outer terminal by default.
Proposed fix
When the shell's subtree contains a tmux client, hop to that client's active pane pid and re-run the same recognition walk from there:
- Detect a tmux client among the descendants.
tmux [-L/-S <sock>] list-clients -F '#{client_pid} #{pane_pid}'→ map our client pid to its active pane pid (one call;#{pane_pid}resolves in the client's context).- Re-run the existing descendant recognition from that pane pid (and also consider the pane's own top process, for
tmux new-session claude).
Best-effort (any tmux failure falls through unchanged), POSIX-only, mirrored in both the local and relay/SSH paths, with a short TTL cache to avoid forking tmux on every foreground poll.
Environment
- Affects both local and SSH remote (relay) sessions.
- POSIX (macOS/Linux); Windows unaffected.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.