fix(panel): find the right iTerm2 tab for tmux panes on any title setup - #201
Merged
Merged
Conversation
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.
Clicking a tmux-hosted event or session was raising iTerm2 without switching to the tab. Focus matched the iTerm2 session
nameagainst tmux'spane_title, andnameis the tab bar title, so with the job shown in the title (✳ stack-nudge (claude)) nothing matched. A profile title setting can also turnautoNameinto just the profile name, so no title is a safe key.Now it goes most exact first:
-CCtabs by iTerm2'stmuxWindowPane, only when a control-mode client is attached to that server (pane numbers repeat across servers)ITERM_SESSION_ID, then its tty(job)suffix) only under-CCand only when it's unique, for iTerm2 builds before 3.3The host terminal now comes from the client's env (
__CFBundleIdentifier, thenTERM_PROGRAM) rather than the agent'sLC_TERMINAL, which is whatever was attached when the pane's shell started.Also adds an Automation → iTerm2 row to Permissions, since that grant is separate from System Events and a denial made focus fail with nothing saying why.
Testing: 1254 tests pass under
make test-without-xcode, and a harness running the real matcher over my live iTerm2 + tmux resolved 30/30 panes, pi included. Not tried live yet: tmux in a normal (non-CC) tab.