You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2f74ffb
Browse filesBrowse the repository at this point in the historyBrowse files
feat(terminal): choose zmux or plain per terminal and restore sessions on unsettle (#1699)
## Problem
With **Managed zmux session** selected, a terminal opened by mouse started as a plain shell.
Unsettling a thread did not bring its zmux session back.
One Appearance setting mixed two choices: launch mode and automatic session creation.
Before ([issue](#1697)):

## Change
### Launch
- **Click events:** no longer mean "open plain"
- **Per terminal:** each carries its own mode
- **Menus:** offer the other shell
- **Server:** honors the per-terminal mode
### Settings
New **Terminal** section in Settings:
| Setting | Values |
| --- | --- |
| Default terminal | Plain shell, zmux shell |
| Create zmux sessions automatically | on, off; follows the default until set |
### Settlement
- **Unsettle:** eagerly recreates the session
- **Gate:** the auto-create toggle
- **Docs:** `managed-terminals.md` updated
## Scope and approval
Closes#1697.
Design decisions are recorded in the issue: eager recreate, one toggle, new Terminal section.
Not built: the issue's "zmux session created" launch-timeline row.
## Close conditions
### Launch
- [x] Mouse open: follows the default mode
- [x] Keyboard open: follows the default mode
- [x] Test: covers the click-event path
- [x] Menus: offer zmux and plain shells
### Settings
- [x] Launch mode: its own setting
- [x] Auto-create: its own toggle
- [x] Home: new Terminal section
### Settlement
- [x] Unsettle: recreates the session eagerly
- [x] Toggle off: unsettle creates nothing
- [x] Docs: managed-terminals.md matches
## Verification
Build `894fd10bab0`, isolated web dev server, scratch repo with one worktree thread.
### Checks
| Check | Exit |
| --- | --- |
| `tsc` contracts, web, server | 0 |
| Web tests (4 files, 28 tests) | 0 |
| Server fork tests (3 files) | 0 |
| Upstream client compat test | 0 |
| Web and server builds | 0 |
| `vp run fork:ci` | 0 |
### Settings

### Launch
Clip: click **Terminal** in the empty right panel, then **New plain shell** from the + menu.
`echo "TMUX=[${TMUX%%,*}]"` prints the socket for zmux and `TMUX=[]` for plain.
| Span | Real | Clip |
| --- | --- | --- |
| page settle | 1.5s | cut |
| idle before menu | 5s | cut |
| tail | 1.9s | cut |
https://github.com/user-attachments/assets/c3ced7e1-a050-45fd-8eb5-726986c19c3c

![Plain shell prints TMUX=[]](https://github.com/user-attachments/assets/667db423-2730-435d-8c8c-8dbf69f3bfa3)
### Settlement
Measured with `zmux ls` on the scratch project:
| Toggle | Settle | Unsettle |
| --- | --- | --- |
| on | session removed | `zmux-proof/t3/reply-only-ok` recreated at the worktree |
| off | session removed | no session |
No console errors during the runs.
Claude Opus 5.5 in Claude Code, hosted by T3 Code.
## Fork trailers
Squashes:
- aeed704 feat(terminal): choose zmux or plain per terminal and restore sessions on unsettle (#1699) (#1699)
- 92d6a4a fixup! feat(terminal): choose zmux or plain per terminal and restore sessions on unsettle (#1699) (#1699)
- 6a65388 feat(terminal): choose zmux or plain per terminal and restore sessions on unsettle (#1699) (#1699)
- d4d07d5 fixup! feat(terminal): choose zmux or plain per terminal and restore sessions on unsettle (#1699) (#1699)
- 807fff4 feat(terminal): choose zmux or plain per terminal and restore sessions on unsettle (#1699) (#1699)
- ac65619 fixup! feat(terminal): choose zmux or plain per terminal and restore sessions on unsettle (#1699) (#1699)
Fork-Domain: zmux-estate
Fork-Tier: qol
Fork-Upstreamable: no
0 commit comments