mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 05:12:29 +00:00
When node-pty (or other PTY libraries) passes a PTY master fd to tty.ReadStream, Bun's implementation would: 1. Auto-close the fd when the stream was destroyed, closing the fd that node-pty still owned 2. Treat EAGAIN errors from non-blocking PTY reads as fatal, destroying the stream prematurely This caused the shell process to receive SIGHUP because the PTY master was unexpectedly closed. Changes: - Set autoClose: false in tty.ReadStream when an fd is provided - Handle EAGAIN in fs.ReadStream._read() by retrying instead of destroying the stream Fixes #25822 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>