Skip to content

Fix noninteractive tty stream constructors - #2136

Merged
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-tty-noninteractive-streams
May 28, 2026
Merged

Fix noninteractive tty stream constructors#2136
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-tty-noninteractive-streams

Conversation

@andrewtdiz

Copy link
Copy Markdown
Contributor

Summary

  • reject valid-but-non-TTY tty.ReadStream / tty.WriteStream constructor calls with SystemError / ERR_TTY_INIT_FAILED
  • stop fallback class id 0 from making anonymous objects satisfy instanceof checks such as process.stdout instanceof tty.WriteStream

Verification

  • Baseline focused node-suite/tty: 29 pass / 2 fail, report test-parity/reports/parity_report_20260527_210503.json
  • ./run_parity_tests.sh --suite node-suite --module tty/classes --filter color-depth-env PASS, report test-parity/reports/parity_report_20260527_211100.json
  • ./run_parity_tests.sh --suite node-suite --module tty/classes --filter readstream-constructor-errors PASS, report test-parity/reports/parity_report_20260527_211101.json
  • ./run_parity_tests.sh --suite node-suite --module tty PASS 31/31, report test-parity/reports/parity_report_20260527_211231.json
  • cargo test -p perry-runtime --lib tty -- --nocapture PASS (existing warnings only)
  • cargo test -p perry-runtime --lib instanceof -- --nocapture PASS, 0 matching tests (existing warnings only)
  • cargo fmt --check
  • git diff --check

DeepWiki

  • reference/deepwiki/nodejs-node-tty-noninteractive-stream-constructors-2026-05-27.md (local-only reference, not staged)

Non-goals

  • no real TTY-backed net.Socket stream implementation
  • no process stdio stream rewrite
  • no full terminal color-depth support
  • no broad instanceof refactor beyond guarding class id 0

Closes #793

@proggeramlug
proggeramlug merged commit 3ad89d7 into PerryTS:main May 28, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Roadmap: Node.js + TypeScript compatibility & stability

2 participants