Repository navigation
Name the iTerm2 overlay pane so the tab keeps its label - #309
Conversation
A tab's label and the OS window title both come from the tab's active session, and the overlay pane is created without a name of its own. Where the parent session's name interpolates variables, the split inherits the name setting but not the variables behind it, so both surfaces read empty for as long as the review is up: measured on iTerm2 3.6.11, the overlay's name evaluates to `<b></b>` while the parent reads `<b>PARENT</b>`. Every other backend already labels its overlay from OVERLAY_TITLE — tmux via -T, zellij --name, herdr --label, kitty --title, the emacs frame name. This passes the same title into the iTerm2 branch and sets it on the session the split returns, which also reverts on its own when the pane closes, the name being the session's. The title goes after the existing argv items on purpose: the test stub's osascript arm dispatches on argument count and on `$3` being executable, so an earlier insertion would shift the launch script out from under it. Fixes #307
|
two gaps against what #307 proposed.
no test. The issue proposed an args-capture assertion in the on the results table, I couldn't reproduce either the empty pane name or the window title moving. Measurements are in #307. The pane falls back to the profile's default title rather than rendering empty, and the window title never changed here at all. Worth trimming the claim to what the fix actually restores, the tab label. |
The planning hook's launcher splits the same way and computes its own OVERLAY_TITLE, so plan reviews kept the unlabelled tab this branch fixes for diff reviews. Also trims the comment beside the fix: the pane falls back to the profile's default title rather than rendering empty, and the OS window title is not the session name, so only the tab label is at stake.
The other backends pass OVERLAY_TITLE as a CLI flag the exit-code matrix already runs; iTerm2 hands it to AppleScript through argv, which no test read, so dropping the argument again would go unnoticed. FAKE_OSASCRIPT_ARGS_FILE records each osascript invocation in the fake backend, mirroring FAKE_AGTERM_ARGS_FILE, and the new test asserts the split call ends with the title for all three launchers.
Context
The iTerm2 overlay opens as a split pane, and that pane is created with no name of its own. A tab's label comes from its active session, so once the overlay takes focus the tab falls back to the profile's title for the duration of the review and stops saying which session it belongs to. #307 carries the measurements.
tmux (
-T), zellij (--name), herdr (--label), kitty (--title) and the emacs frame name already label their overlay fromOVERLAY_TITLE. iTerm2 is not the only backend that doesn't — wezterm, cmux, ghostty and agterm don't either — it is the one whose pane visibly relabels the tab. This passes the same title into the iTerm2 branch and sets it on the session the split returns. Nothing has to undo it afterwards: the name belongs to the session, so it goes when the pane does.Reach is narrow: on a stock profile the parent and the overlay render the same title and the tab doesn't change. This shows up for people who name their sessions.
Review guide
set name of newSession to overlayTitleafter the split, with$OVERLAY_TITLEappended to theosascriptargv, in.claude-plugin/skills/revdiff/scripts/launch-revdiff.sh# source: … (keep in sync)headerplugins/revdiff-planning/scripts/launch-plan-review.sh— the planning hook splits the same way and computes its ownOVERLAY_TITLE(plan: <file>), so plan reviews had the same unlabelled tabosascriptarm ofapp/testdata/plugin-exit-code/fake-overlay-backend.shdispatches on argument count plus-x "$3", so an earlier position would shift the launch script out from under the stub. Appending leaves the stub's dispatch intact.TestIterm2OverlayNamesSessionasserts the splitosascriptargv ends with the overlay title for all three launchers. The other backends passOVERLAY_TITLEas a flag thatTestShellLaunchersPreserveAnnotationExitCodealready runs; iTerm2 hands it to AppleScript through argv, which nothing read, so a dropped argument was invisible. Capture is a newFAKE_OSASCRIPT_ARGS_FILEin the fake backend, mirroringFAKE_AGTERM_ARGS_FILE.Testing
Ran the launcher for real on iTerm2 3.6.11 / macOS 26.5.2, against a profile whose session name interpolates a session variable:
master<b>\(user.probe_var)</b>with the variable missing. On a stock profile it is the default title text.rd: revdiff [HEAD~1]rd: revdiff [HEAD~1]The tab label is what the fix restores. My OS window title emptied along with it, but @umputun's never moved, so that part follows from window title components rather than from the session name.
go test ./...passes and the CI shellcheck gate is clean on all three launchers.