Repository navigation
terminal: tab icon follows the focused pane's agent - #1018
Merged
Merged
Conversation
onevcat
force-pushed
the
feat/tab-icon-follows-focused-agent
branch
from
October 31, 2026 13:24
a7da134 to
b0a1c8d
Compare
A tab has one icon but can hold several panes. The icon kept the last value written, so a Claude pane could show a Git icon from the split beside it, and an agent detected in an unfocused split never reached the tab. Apply the agent's icon when focus moves to its pane. User and script icons stay. A pane without an agent does not follow focus: it has no record of its current command, so its next command decides.
onevcat
force-pushed
the
feat/tab-icon-follows-focused-agent
branch
from
October 31, 2026 13:27
b0a1c8d to
7e4d724
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #1017. The base branch is that PR's branch, so this diff shows only the focus change.
Problem
A tab has one icon but can hold several panes. The icon keeps the last value written:
Change
recordActiveSurfaceis the point that both programmatic focus and the surface focus callback go through. It now applies the agent's icon when the newly focused pane has a detected agent. Lookup order is the same as for detection: process name, then agent.The change uses
applyResolvedIcon, so the lock rules are the same as for titles and detection. Script icons also stay, because the documented precedence isauto < script < user.Verification
WorktreeTerminalStateTabIconTests. 5 failed without the focus call. All 21 tests in the suite pass with it. The others are control cases for plain panes and locked icons.make check,make test(prowl-tests5049 passed, 0 failed, 11 skipped), andmake build-apppass.prowl focus. Evidence is from window screenshots, becauseprowl listhas no icon field.Left split: Claude. Right split: plain shell. The steps, top to bottom: run
git logon the right, focus left, focus right.Before (only #1017): the Git icon stays on the Claude pane.

After: the icon returns to Claude on focus, and stays Claude when focus moves to the plain pane.

Left split: Claude. Right split: Codex, detected while unfocused. The steps, top to bottom: before focus, focus right, focus left.

Not tested manually: focus by mouse click (a unit test calls the surface focus callback directly), and user or script icons (unit tests only).