Status and attention
Running many sessions is only useful if you can tell, at a glance, which one needs you. Every session carries one of five activity statuses:
| Status | Means |
|---|---|
starting | spawned, nothing heard from it yet |
busy | running a command / thinking |
idle | at a prompt, waiting for input |
attention | actively wants you — a permission prompt, a question |
exited | the program is gone |
The status drives the tab activity dot, the focused-terminal badge, the
marks of a waiting session, the close
confirmation, and the MCP wait_for_status tool.
When a session waits for you
A session in attention is marked wherever you might be looking:
| Where | Mark |
|---|---|
| its tab, when another tab is active | the chip is tinted red |
| its pane, in a split, when it does not hold the keyboard | a red frame, kept when the window loses focus |
| the end of the tab strip | N waiting; a click goes to the next one |
| the Dock icon (macOS) | the number of sessions waiting |
next-attention (mod+shift+a) goes to the next waiting session after the
focused pane, across tabs and splits, and wraps around. With none waiting it
does nothing. Every mark clears when the session resumes work.
A session’s own colour (/color) outlines its tab and marks its sidebar row;
a waiting mark is a fill, a frame or words instead, so a red session is never
mistaken for one that waits.
Where the signal comes from
Status is folded from what the terminal says about itself — not guessed from output text.
Claude sessions report through the CLI’s OSC title stream. Two things are needed for that stream to exist, and TermHerd arranges both:
- The CLI only emits its busy/idle/attention stream when it detects iTerm2 as
the host, so the PTY adapter advertises
TERM_PROGRAM=iTerm.app(with a version) on every spawned session. - A
CLAUDE_CODE_DISABLE_TERMINAL_TITLEin your own~/.claude/settings.jsonwould silence it entirely, and thatenvblock outranks the environment TermHerd spawns with. So a Claude launch passes a private--settingsoverlay, which outranks it in turn and merges with — never replaces — your settings. The flag needs Claude Code 1.0.61; the CLI floor sits higher still, at 2.0.73, for--session-id(see Installation).
The CLI’s own product name (✳ Claude Code), which it reports until it has
something session-specific to say, is ignored: a tab would otherwise trade its
project name for the program’s.
Plain shells get an injected OSC 133 shell-integration snippet, whose prompt and command marks fold into the same status:
| Shell | How | Always on? |
|---|---|---|
| zsh | a private ZDOTDIR | ✅ yes, unless ~/.zshenv sets ZDOTDIR |
| bash | --rcfile | only when named in settings.shell |
| fish | --init-command | only when named in settings.shell |
Each recipe replays your startup files first, so your prompt and aliases are untouched.
Bash and fish need their snippet as a command-line argument, and TermHerd
will not add one to the platform’s default program — that would demote your
login shell to an ordinary one and change which startup files run. So: name
your shell explicitly in settings.json to get the finer marks. zsh needs no
argument and is integrated by default — unless your ~/.zshenv itself sets
ZDOTDIR, which takes zsh away from TermHerd’s files: see
Environment variables.
Where injection cannot apply — an unknown shell, an unwritable temp
directory — the PTY’s foreground process group stands in. It is retired for
good by the first real mark or Claude signal, so it can never contradict what
the terminal says about itself. Windows ConPTY exposes no foreground process
group, so a shell with neither route stays on starting there.
Desktop notifications
When a session asks for you (Claude’s OSC 9 notification), TermHerd posts a desktop notification titled with the session’s tab name and carrying Claude’s message. None is posted for the pane you are already looking at while the TermHerd window has focus.
Clicking the notification brings you back to that session:
TermHerd comes to the front — restored first if it was minimised — and
activates the tab and pane that raised it, the same reveal the MCP
focus_pane tool performs. The notification
remembers the session, not the tab title, so two tabs with the same name are
never confused. If the tab was closed in the meantime, or a prompt is open (a
close or quit confirmation, the settings panel, the document editor), the
click brings TermHerd forward and changes nothing else; an inline rename is
dismissed, as any click elsewhere dismisses it. Dismissing the notification
does nothing.
Confirmed on macOS only. A real click brought the right tab forward. The minimised-window and open-prompt cases, and the Linux and Windows rows, are read from the notification libraries’ sources.
| OS | Click reaches TermHerd | Window comes forward |
|---|---|---|
| macOS | ✅ while the banner is still in the notification centre | ✅ |
| Linux | ⚠️ only if the notification server supports actions | ❓ Wayland may refuse |
| Windows | ⚠️ only while the toast is on screen — once it times out into the action centre, the click is lost | ❓ may only flash the taskbar |
On Linux a session’s new notification replaces its previous one, so each session shows one banner. On Windows the toast is attributed to PowerShell until TermHerd registers its own application id.
At most 16 notifications wait for a click at once; past that, a new one still appears but clicking it does nothing, until earlier ones are clicked or dismissed.
Close confirmation
Closing is governed per action — tab and app — by one of three policies:
| Policy | Behaviour |
|---|---|
alwaysConfirm | always ask |
confirmWhenActive | default — ask only while a session runs a foreground process |
noConfirmation | never ask |
Under the default, “runs a foreground process” means:
| Session | Runs a foreground process while |
|---|---|
| Claude | it has not exited, an idle prompt included |
| shell, macOS and Linux | it is busy or attention, or a program other than the shell has the terminal (vim, less, htop, a long make) |
| shell, Windows | it is busy or attention, a Claude runs in it, or a program is on the alternate screen (vim, less) |
On macOS and Linux TermHerd reads which process owns the terminal, so a
program in front of the shell counts even when the status reads idle: after
a claude typed by hand has exited, for instance, Claude’s last title can
leave the shell reading idle while vim runs. Windows has no such reading:
there TermHerd finds only a Claude below the shell, so beyond the status only
a Claude and full-screen programs count; a long command a shell without
integration runs closes without asking.
Quitting names the cost: “Quit TermHerd? 3 open sessions will be
force-stopped — any running work is lost.” Every non-exited session dies on
quit, Claude or shell. A doc with unsaved changes is named in the same prompt,
and makes the quit ask under every policy, noConfirmation included.
Every confirmation is answerable from the keyboard — Escape to cancel, Enter to confirm — which is also what makes them reachable from MCP.