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 7f4c625
Browse filesBrowse the repository at this point in the historyBrowse files
authored and
rsi-pr-agent
committed
fix(terminal): close T3 viewers of a settled lane's removed zmux session (#1876)
## Problem
Settling a lane removes its zmux session, but T3 only suspends its own viewer of that session.
The suspended viewer still counts as running.
On reopen it resumes as a plain shell that keeps the old lane history.
## Change
After `binder.unbind` confirms the session is gone (`unbound` or `not-found`), `SettledLaneSessions` calls the new `TerminalManager.closeSettledManagedAttachments({ target })`.
- **Viewers:** live and retained ones close
- **History:** deleted; T3 closes the tab
- **Refusal:** any other outcome closes nothing
- **Reopen while settled:** labeled read-only shell
- **Unsettle:** new terminal opens fresh session
Known limit: a shell opened while settled stays a plain shell after unsettle; open a new terminal.
## Scope and approval
Closes#1671.
#1738 dropped its settlement work and asked for a simpler design; this is that design.
- [ ] **Cause:** identify the stale lifecycle path.
- [ ] **Settle:** define visible terminal behavior.
- [ ] **Unsettle:** define fresh-session display.
- [ ] **Proof:** verify the policy beside Ghostty.
## Verification
- [x] **Red first:** new settlement test fails on trunk
- [x] **Targeted tests:** 28 passed
- [x] `vp run typecheck` (apps/server) → exit 0
- [x] `vp run build` (apps/server) → exit 0
- [x] `vp run fork:ci` → exit 0
- [x] `vp run check:changed` → exit 0
- [x] **Sidebar reopen, hard reload:** no old history
- [x] **Settled row:** no stale running count
**Build:** `5a398845f8d` on an isolated dev server.
Before (trunk, 81 s, uncut): reopen after Settle resumes a plain shell that keeps the old lane history.
https://github.com/user-attachments/assets/4a9b3145-e2e6-42da-a806-95da7f68a702
After (T3 beside Ghostty, 22 s): Settle closes the T3 terminal as Ghostty drops `lane-1671`; Unsettle restores it; a new terminal opens the fresh session.
https://github.com/user-attachments/assets/fd5ed777-b5ef-4137-8a62-5093a7d6ca0d
| Span | Real | Clip |
| --- | --- | --- |
| 0–7 s | 7 s | kept |
| 7–19 s, idle | 12 s | cut |
| 24–30 s, idle | 6 s | cut |
| 34–108 s, zmux busy retry and dialogs | 74 s | cut |
| after 114 s | 24 s | cut |
Sidebar reopen after Settle, from another thread: labeled plain shell, no old marker.

Opus 5.5 via Claude Code.
## Fork trailers
Squashes:
- 9529335 fix(terminal): close T3 viewers of a settled lane's removed zmux session (#1876) (#1876)
- ba5ad54 fixup! fix(terminal): close T3 viewers of a settled lane's removed zmux session (#1876) (#1876)
Fork-Domain: zmux-estate
Fork-Tier: bugfix
Fork-Upstreamable: no
Co-authored-by: donjor <[email protected]>
0 commit comments