Python API for tab groups (create, assign, rename, color, collapse, read)
Tab groups (3.7) can't be created, assigned, renamed, colored, collapsed or even read from the Python API, so anything that manages tabs programmatically can't use them.
I run 20+ terminal sessions from scripts (a tab per agent session, grouped by project) and save/restore the whole layout across restarts. Groups are the one piece that can't be scripted, so every restart loses them and I have to rebuild them by hand.
What I checked on 3.7.1:
proto/api.protohas no RPC that mentions groups.iterm22.13 has nothing for tab groups.tabGroupID,tabGroupName,tabGroupColorandtabGroupCollapsedreturnNonefor every tab, grouped or not, so a script can't even tell whether a tab is in a group. Setting them raisesINVALID_NAME.- No escape sequence, trigger action or AppleScript term covers groups.
async_select_menu_itemcan invoke "Add Tab to New Group", but it opens a modal name prompt, and there is no menu item for joining an existing group, renaming, coloring or collapsing.
What would help, in priority order:
- Read access: group id, name, color and collapsed state as tab variables that actually return values.
- RPCs to create a group, add or remove a tab, rename, set color, and collapse or expand.
- Groups saved and restored with arrangements the scripts already use, so a script that restores a layout gets its groups back.
Related: #13069 asks for groups to persist across tmux detach/reattach. Same underlying gap.