tmux integration: persist tab groups across detach/reattach
iTerm2 version: 3.7.3, macOS 26 (Darwin 25.3.0)
What happens
I use tmux -CC over SSH as my main workflow and organize the tmux windows (iTerm tabs) into tab groups, with names, colors and collapse state. When the window closes or the connection drops and I reattach with tmux -CC attach, every tab comes back with its title, layout and window affinity, but all tab groups are gone, so I have to rebuild them by hand each time.
What I checked
While a group was live, I dumped the session options iTerm stores in tmux:
@per_tab_settings → "8:t=<base64 title>" (titles only)
@per_window_settings → "pty-…:size={1800, 1129};…"
@affinities, @origins, @tab_colors, @buried_indexes, @hiddenNothing records group membership, name, color or collapsed state. Tab titles and tab colors do survive, because they're in @per_tab_settings and @tab_colors.
Request
- Save tab group state with the tmux session, either as extra keys in
@per_tab_settings(for exampleg=<group id>) plus a session option for each group's name, color and collapsed flag, or as a new@tab_groupsoption. Then restore it on attach the same way titles are restored. - Nice to have: tab group support in the Python API and AppleScript (create a group, add or remove a tab, set name, color and collapsed state, and list groups). With that, users could script their own restore, and it would cover non-tmux workflows too.
Repro
ssh host -t 'tmux -CC new -A -s dev'- Open 3 tabs and put 2 of them in a new tab group with a name and color.
- Close the window and choose detach, or kill the SSH connection.
- Run the command from step 1 again. The tabs return, but the group doesn't.
Thanks. Tab groups plus tmux integration is a great combo for running many parallel agent sessions; persistence is the one missing piece.