Skip to content

fix(node): make process.stdout.isTTY writable - #26130

Merged
marvinhagemeister merged 2 commits into
mainfrom
node-process-write-isTTY
Oct 11, 2024
Merged

marvinhagemeister merged 2 commits into
mainfrom
node-process-write-isTTY

Conversation

@marvinhagemeister

Copy link
Copy Markdown
Contributor

Fixes #26123

@satyarohith satyarohith left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marvinhagemeister
marvinhagemeister merged commit 9117a9a into main Oct 11, 2024
@marvinhagemeister
marvinhagemeister deleted the node-process-write-isTTY branch October 11, 2024 17:14
nrako added a commit to nrako/deno that referenced this pull request Nov 30, 2025
In Node.js, `tty.ReadStream` sets `isTTY` as a simple instance property
(`this.isTTY = true`), making it naturally writable. Deno's polyfill
used a getter-only property definition, preventing assignment.

Some npm packages need to override `isTTY` at runtime. For example,
Playwright's test server sets `process.stdin.isTTY = undefined` to
prevent reporters from blocking on user input during UI mode
(microsoft/playwright#37867).

This aligns stdin with the stdout/stderr fix from denoland#26130, ensuring all
stdio streams behave consistently with Node.js.

Refs:
- https://github.com/nodejs/node/blob/main/lib/tty.js
- https://github.com/microsoft/playwright/blob/main/packages/playwright/src/runner/testServer.ts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
nrako added a commit to nrako/deno that referenced this pull request Nov 30, 2025
In Node.js, `tty.ReadStream` sets `isTTY` as a simple instance property
(`this.isTTY = true`), making it naturally writable. Deno's polyfill
used a getter-only property definition, preventing assignment.

Some npm packages need to override `isTTY` at runtime. For example,
Playwright's test server sets `process.stdin.isTTY = undefined` to
prevent reporters from blocking on user input during UI mode
(microsoft/playwright#37867).

This aligns stdin with the stdout/stderr fix from denoland#26130, ensuring all
stdio streams behave consistently with Node.js.

Refs:
- https://github.com/nodejs/node/blob/main/lib/tty.js
- https://github.com/microsoft/playwright/blob/main/packages/playwright/src/runner/testServer.ts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
bartlomieju pushed a commit that referenced this pull request Dec 1, 2025
## Summary

In Node.js, `tty.ReadStream` sets `isTTY` as a simple instance property
(`this.isTTY = true`), making it naturally writable. Deno's polyfill
used a getter-only property definition, preventing assignment.

Some npm packages need to override `isTTY` at runtime. For example,
Playwright's test server sets `process.stdin.isTTY = undefined` to
prevent reporters from blocking on user input during UI mode
(microsoft/playwright#37867).

This aligns stdin with the stdout/stderr fix from #26130, ensuring all
stdio streams behave consistently with Node.js.

## Refs
-
https://github.com/nodejs/node/blob/6a1a3ba045ad7d8d46ca443c5bb73b172d6828c3/lib/tty.js#L71
-
https://github.com/microsoft/playwright/blob/3a5a32d26da3c4da1bd45b71c8b9864e1ea480c9/packages/playwright/src/runner/testServer.ts#L257-L266

Co-authored-by: Claude <noreply@anthropic.com>
bartlomieju pushed a commit that referenced this pull request Jan 22, 2026
## Summary

In Node.js, `tty.ReadStream` sets `isTTY` as a simple instance property
(`this.isTTY = true`), making it naturally writable. Deno's polyfill
used a getter-only property definition, preventing assignment.

Some npm packages need to override `isTTY` at runtime. For example,
Playwright's test server sets `process.stdin.isTTY = undefined` to
prevent reporters from blocking on user input during UI mode
(microsoft/playwright#37867).

This aligns stdin with the stdout/stderr fix from #26130, ensuring all
stdio streams behave consistently with Node.js.

## Refs
-
https://github.com/nodejs/node/blob/6a1a3ba045ad7d8d46ca443c5bb73b172d6828c3/lib/tty.js#L71
-
https://github.com/microsoft/playwright/blob/3a5a32d26da3c4da1bd45b71c8b9864e1ea480c9/packages/playwright/src/runner/testServer.ts#L257-L266

Co-authored-by: Claude <noreply@anthropic.com>
bartlomieju pushed a commit to bartlomieju/deno that referenced this pull request Jan 26, 2026
## Summary

In Node.js, `tty.ReadStream` sets `isTTY` as a simple instance property
(`this.isTTY = true`), making it naturally writable. Deno's polyfill
used a getter-only property definition, preventing assignment.

Some npm packages need to override `isTTY` at runtime. For example,
Playwright's test server sets `process.stdin.isTTY = undefined` to
prevent reporters from blocking on user input during UI mode
(microsoft/playwright#37867).

This aligns stdin with the stdout/stderr fix from denoland#26130, ensuring all
stdio streams behave consistently with Node.js.

## Refs
-
https://github.com/nodejs/node/blob/6a1a3ba045ad7d8d46ca443c5bb73b172d6828c3/lib/tty.js#L71
-
https://github.com/microsoft/playwright/blob/3a5a32d26da3c4da1bd45b71c8b9864e1ea480c9/packages/playwright/src/runner/testServer.ts#L257-L266

Co-authored-by: Claude <noreply@anthropic.com>
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.

Node compat: process.stdout.isTTY has only a getter

2 participants