Files
bun.sh/test/regression
Claude Bot 820f7aa74a fix(tty): prevent tty.ReadStream from closing caller-owned PTY fds
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>
2026-01-12 11:37:49 +00:00
..