Skip to content

Commit 0e469fe

Browse files
docs: define machine detach packet direction
1 parent 23346c6 commit 0e469fe

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
@@ -491,7 +491,7 @@ socket.on("data", (raw) => {
491491
const MessageType = {
492492
DATA: 0, // Terminal output / input
493493
ATTACH: 1, // Client attach with size
494-
DETACH: 2, // Client detach
494+
DETACH: 2, // Client → server request; machine stream → caller outcome
495495
RESIZE: 3, // Terminal resize
496496
EXIT: 4, // Process exited
497497
SCREEN: 5, // Screen replay
@@ -501,6 +501,12 @@ const MessageType = {
501501
};
502502
```
503503

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

0 commit comments

Comments
 (0)