a5c2aba0
docs: a session muxa can join is one that already exists
a73x 2026-08-26 06:24
Commit message
README.md
| Old | New | ||
|---|---|---|---|
| @@ -395,10 +395,14 @@ make bench # typing-workload byte-ratio measurement | |||
| 395 | `--quic HOST`. `muxa run "make test"` sends the command line, waits for the | 395 | `--quic HOST`. `muxa run "make test"` sends the command line, waits for the |
| 396 | shell to return it, and prints the exit code with the output rows; no | 396 | shell to return it, and prints the exit code with the output rows; no |
| 397 | polling and no sleeps, because the daemon holds the wait. It attaches at | 397 | polling and no sleeps, because the daemon holds the wait. It attaches at |
| 398 | 0×0 so it never resizes the session a human is using, and every reply names | 398 | 0×0 so it never resizes the session a human is using — which also means it |
| 399 | the `mechanism` that answered — an exit code is real only under `marks` | 399 | can only join a session that already exists, and `--session NAME` for a name |
| 400 | (OSC 133 shell integration, injected at spawn), absent under the `pgid` and | 400 | no daemon holds prints `{"error":"attach refused"}` and exits 1 rather than |
| 401 | `settle` fallbacks. | 401 | creating one. (`capture` is the exception: it reads by name without |
| 402 | attaching, so it answers `{"grid":"muxd: no such session: NAME"}` and exits | ||
| 403 | 0.) Every reply names the `mechanism` that answered — an exit code is real | ||
| 404 | only under `marks` (OSC 133 shell integration, injected at spawn), absent | ||
| 405 | under the `pgid` and `settle` fallbacks. | ||
| 402 | 406 | ||
| 403 | Marks are **opt-in**: start the daemon with `MUX_SHELL_INTEGRATION=1` in its | 407 | Marks are **opt-in**: start the daemon with `MUX_SHELL_INTEGRATION=1` in its |
| 404 | environment, or `muxa` gets the fallbacks and no exit code. The injection is | 408 | environment, or `muxa` gets the fallbacks and no exit code. The injection is |
web/mux.js
| Old | New | ||
|---|---|---|---|
| @@ -595,14 +595,16 @@ class Tile { | |||
| 595 | } | 595 | } |
| 596 | sendAttach(fresh) { | 596 | sendAttach(fresh) { |
| 597 | // THE PASSIVITY CONTRACT: an unzoomed wall tile attaches at 0x0, which | 597 | // THE PASSIVITY CONTRACT: an unzoomed wall tile attaches at 0x0, which |
| 598 | // is how the CLI wall's stripes and muxa spell the same thing — no size | 598 | // is how muxa and an argv-only CLI wall view (`mux wall SPELLING...`) |
| 599 | // claim at all. The daemon answers a unicast snapshot carrying the true | 599 | // spell the same thing — no size claim at all. Every CLI tile that |
| 600 | // CREATES claims its own rect instead, and has done since panes | ||
| 601 | // landed. The daemon answers a unicast snapshot carrying the true | ||
| 600 | // grid and the slot stays 0x0 forever, so this tile can never move the | 602 | // grid and the slot stays 0x0 forever, so this tile can never move the |
| 601 | // shared session. Only the zoomed tile claims its real size. | 603 | // shared session. Only the zoomed tile claims its real size. |
| 602 | // | 604 | // |
| 603 | // 0x0 rather than a small size on purpose: 1x1 is a size a client on a | 605 | // 0x0 rather than a small size on purpose: 1x1 is a size a client on a |
| 604 | // tiny terminal genuinely sends, so it cannot mean "no claim" without | 606 | // tiny terminal genuinely sends, so it cannot mean "no claim" without |
| 605 | // also meaning "this client wants 1x1" (server.zig attachOrCreate). | 607 | // also meaning "this client wants 1x1" (server.zig resolveSession). |
| 606 | // ONE gate for every attach, wherever it comes from — the `up` | 608 | // ONE gate for every attach, wherever it comes from — the `up` |
| 607 | // control message included. A tile that gave up on replaying must | 609 | // control message included. A tile that gave up on replaying must |
| 608 | // not be talked back into asking for the same frame again. | 610 | // not be talked back into asking for the same frame again. |