szn

Bug 418 — Detached clients keep a live control channel

418. Detached clients keep a live control channel: after .detach the fd stays in client_fds and can still inject stdin/commands

Severity: LOW Status: ✅ RESOLVED

The .detach packet branch removes the entry from display_clients only. The socket remains registered in client_fds with its MessageReader live: .stdin_data (:2496-2498) and .command from that socket keep acting on the global active session — keystroke injection, kill-session, everything — until the peer closes. tmux kills the detached client process; szn’s detach is advisory and leaves the channel open.

Fix: on detach completion, close the connection (client’s contract is exit-on-detach, cf. main.zig handling) or gate handleClient to .detach/.redraw for retired display clients.