Skip to content

Commit badc353

Browse files
docs: define machine detach packet direction
1 parent 9531d44 commit badc353

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

docs/client.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ socket.on("data", (raw) => {
453453
const MessageType = {
454454
DATA: 0, // Terminal output / input
455455
ATTACH: 1, // Client attach with size
456-
DETACH: 2, // Client detach
456+
DETACH: 2, // Client → server request; machine stream → caller outcome
457457
RESIZE: 3, // Terminal resize
458458
EXIT: 4, // Process exited
459459
SCREEN: 5, // Screen replay
@@ -463,6 +463,12 @@ const MessageType = {
463463
};
464464
```
465465

466+
`DETACH` always has an empty payload. On the session socket it requests that
467+
the client connection detach. On `--attach-stream-fd-v1`, it is the terminal
468+
outcome for an intentional local detach and is flushed before clean completion.
469+
Clean EOF follows either `DETACH` or `EXIT`; EOF without either outcome is a
470+
truncated stream.
471+
466472
Packet types are length-delimited. Clients predating `GEOMETRY` ignore the
467473
unknown bounded packet and continue with following `SCREEN`/`DATA`, preserving
468474
their historical raw-byte behavior. Embedders that reconstruct a terminal grid

0 commit comments

Comments
 (0)