pty: closing a pane hangs up its terminal (#144)

The pump thread reads from its own dup of the PTY master, so dropping the
handle on close never closed the last master descriptor. The child got
only the close signal (TERM by default) and no hangup; an interactive
shell ignores TERM and kept running, with its pump thread parked forever.

The reader now also polls a close-on-exec pipe whose write end lives in
the handle. Dropping the handle wakes the reader, the pump drops the
master dup before waiting, and the kernel hangs up the terminal.

Co-authored-by: Grok Bot <grok-bot@users.noreply.github.com>
7311c5c255Simone committed on 10/19/2026, 1:15:48 AM· committed by GitHubparent2b24bbe
2 files changedLine totals unavailable