mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-09-22 00:02:23 +00:00
On macOS, setsockopt against a socket whose peer has already closed fails with EINVAL. The daemon answers a bad request by writing one Error frame and hanging up at once, so PaneSession's `set_recv_timeout(...)?` would fail before the refusal was ever read — turning "no such pane 42", already sitting in the buffer, into "Invalid argument". Bounding the reply wait is an optimisation, not a correctness requirement, so it is now best effort in both attach/observe and spawn. Nothing can hang as a result: a closed peer returns EOF immediately, and a live peer is exactly the case where setsockopt succeeds. This is what made client_lib's reattach test red.