fix(server): restore alt-screen mode on SCREEN replay (#49)
Track whether the child has entered the alternate screen buffer (DEC
private modes ?1049 / ?1047 / ?47) via a new altScreenActive flag on
PtyServer, and prepend \x1b[?1049h to the SCREEN packet payload sent
on ATTACH when the child is currently in alt-screen. PEEK does not
get the prefix — a non-follow peek prints its snapshot into the
caller's shell and exits, so entering alt-screen would hide the
output when the client's TERMINAL_SANITIZE (?1049l) fires on close.
Fixes #41. Before this, a full-screen TUI (vim/htop/codex) attached
through pty would paint into the host's main-screen buffer, which
under tmux meant every full repaint entered scrollback. Observed
impact: 8.7 GB scrollback + 9.1 GB tmux server RSS over 9.5h on a
long-lived codex pane, with 0.4-2.3s server-loop stalls.
The wire format is unchanged — the prefix rides on the existing SCREEN
payload as a strict superset. Old clients (pre-fix) receiving the
prefixed payload just write it verbatim to their terminal and enter
alt-screen correctly. Client-side detach already emits ?1049l via
TERMINAL_SANITIZE, so the round-trip is symmetric.