Files
l0ng-ai ea0a80e84f fix(workspace): make the CLI and the GUI agree on what exists
Five places where a workspace, a tab or an attachment was real on one side
of the socket and invisible on the other. They share a root: the GUI kept
its own list of which workspaces exist, and consulted the machine tree only
for the ones it already knew about.

- The switcher listed only workspaces this client had opened, so anything
  the CLI made was missing from the GUI entirely — `tty7 new` looked like
  it had done nothing. The local group now merges what the machine holds,
  the way the remote groups already did, and `claim` keeps the id it was
  handed instead of quietly opening a fresh workspace beside it. Opening
  one hydrates from the tree whatever `restore_session` says: the setting
  decides whether a window comes back at launch, not whether an open one
  shows what is really in it, and the alternative was saving an empty
  session over live tabs.

- A workspace deleted from another client left its row behind here, opening
  onto nothing. It is now forgotten with it. A window still showing one
  keeps it — `ws rm` leaves the panes running — and puts the workspace back
  under the same id rather than carrying on writing to a tree that has no
  record of it.

- `tty7 ls` could never fill its ATTACHED column: `Workspace::attachment`
  was `serde(skip)`, which kept it off the disk as intended and off the
  wire as a side effect, so a workspace held by a GUI window read to every
  other client as unheld. It now travels, minus the token that proves the
  hold, and is stripped when the document is written instead.

- `tab ls` and `ws tree` printed `tab.name`, which almost no tab has: the
  GUI's strip names tabs from OSC titles the tree never sees. Both now fall
  back through agent, cwd leaf and process name — the same ranking the
  switcher uses, moved into the core so there is one of it — and `tab ls`
  gained a GROUP column.

- `sidebar_group` was readable from the CLI and writable only from the GUI;
  `tab group @TAB [GROUP]` closes that.

Also `tty7 new --open`, which asks a running GUI to put a window on the
workspace it just made: `GuiOpen` now carries a workspace id, since a
workspace with an id has no business being routed to whichever window was
focused last.
2026-08-09 13:39:51 +08:00
..