pty_close_inherited_fds() is undefined on any non-Linux, non-macOS platform (build break on FreeBSD/OpenBSD too)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp
- Domain
- build-system, operating-systems
Research direction
Start in src/unix/pty.cc at the platform-conditional definition of pty_close_inherited_fds() and its call in PtyFork's child branch. Compare the Linux, macOS, and shared non-macOS paths, then verify that the chosen portable handling compiles for FreeBSD, OpenBSD, or another supported POSIX platform without an undefined declaration.
Written by the indexing model from the issue text.
Description
src/unix/pty.cc defines pty_close_inherited_fds() only under #if defined(__linux__), but calls it unconditionally in PtyFork's child branch for every platform that isn't __APPLE__ (i.e. the shared #else branch used by Linux, FreeBSD, OpenBSD, and anything else binding.gyp claims to support). Compiling on FreeBSD/OpenBSD (or any other POSIX platform) should fail with 'pty_close_inherited_fds' was not declared in this scope.
Suggested minimal fix: add a portable fallback (e.g. getrlimit(RLIMIT_NOFILE) + a close() loop from fd 3) under a generic #else branch, or guard the call site itself.
Found while porting node-pty to IBM i PASE (AIX-derived) — see the companion issue about AIX/PASE support for context.
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 337
- Avg merge
- 21h 58m
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/node-pty
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
All issues in microsoft/node-pty
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mksglu/context-mode#1200 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
anthropics/claude-code#96687 ·
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
AOSSIE-Org/DebateAI#582 · 2 comments ·