docs: record mirror size-clamp fix + 🗂 session manager page
This commit is contained in:
@@ -78,7 +78,7 @@ Data flow: `keypress → xterm onData → WS → pty.write() → shell stdin`, a
|
||||
- `attach(null)` → spawn a new PTY + shell; PTY output goes into a ~2MB **ring buffer** and (if a WS is attached) forwards live.
|
||||
- `attach(sessionId)` → look up the session, **replay the ring buffer**, then resume the live stream. This is what makes "refresh the page and the Claude session is still there" work.
|
||||
- WS close → `detach` one client (PTY keeps running), not kill; the idle clock starts only when the **last** client leaves.
|
||||
- **Multi-device sharing (v0.4):** a session may have **many concurrent WS clients** — a new attach **JOINS (mirror)**, it does **not** kick. Output/exit/status broadcast to all; any client can type (shared control); the PTY size is the **min cols/rows across clients** (tmux-style). This relaxes the original "one WS per session" invariant (#5). `GET /live-sessions` lists running sessions so any device **auto-shows them as tabs**; `?join=<id>` and the 🔗 share-QR open a specific shared session.
|
||||
- **Multi-device sharing (v0.4):** a session may have **many concurrent WS clients** — a new attach **JOINS (mirror)**, it does **not** kick. Output/exit/status broadcast to all; any client can type (shared control). The PTY size is the **min cols/rows across *actively-viewing* clients** (tmux-style): a client only votes on size once it sends a `resize`, and a tab going hidden sends a `blur` to **withdraw its vote** (it still mirrors output). This stops a backgrounded mirror from clamping the shared PTY — and relaxes the original "one WS per session" invariant (#5). `GET /live-sessions` lists running sessions so any device **auto-shows them as tabs**; `?join=<id>` and the 🔗 share-QR open a specific shared session; the **🗂 manage page** (`/manage.html`, `DELETE /live-sessions[/:id]`) lists/opens/kills sessions.
|
||||
- Orphan reclaim: detached longer than `IDLE_TTL` (default 24h) **with no new output since detach** → reclaim. (node-pty can't reliably detect a foreground child, so liveness is approximated via last-output time — see ARCHITECTURE §3.5 / M3.) On server exit, `pty.kill()` all sessions (no cross-restart persistence in v0.1; tmux backend is a v0.2 idea).
|
||||
|
||||
Represent session state as immutable snapshots (id/start-time fixed at creation); hold mutable runtime handles (pty/ws) separately.
|
||||
|
||||
Reference in New Issue
Block a user