GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tty: add raw-vt and io raw modes by samuel-williams-shopify · Pull Request #64140 · nodejs/node

Conversation

@samuel-williams-shopify

@samuel-williams-shopify samuel-williams-shopify commented Jun 26, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Adds string raw-mode selection to tty.ReadStream#setRawMode():

  • setRawMode(true) keeps the existing behavior.
  • setRawMode('raw') explicitly selects the existing Node raw mode, backed by libuv UV_TTY_MODE_RAW_VT.
  • setRawMode('io') selects libuv UV_TTY_MODE_IO for binary-safe I/O mode on Unix.
  • readStream.rawMode exposes the exact current mode while readStream.isRaw remains boolean for compatibility.
  • Unknown string modes are rejected.

This is intended to address the output-processing distinction discussed in #63059 and follows libuv's existing UV_TTY_MODE_IO semantics. It preserves the current setRawMode(true) behavior instead of changing it.

Related libuv hardening PR: libuv/libuv#5174

Refs: #63059
Refs: libuv/libuv#32

Local verification:

  • git diff --check passes.
  • A full local build could not complete because macOS killed Cargo build-script-build executables as untrusted on this machine; relying on CI for the native build and pseudo-tty test run.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. tty Issues and PRs related to the tty subsystem. labels Jun 26, 2026
@samuel-williams-shopify samuel-williams-shopify mentioned this pull request Jun 26, 2026
doc: clarify tty raw mode applies to input processing only #63438
Merged
4 tasks done
@samuel-williams-shopify
samuel-williams-shopify force-pushed the tty-raw-vt-io-mode branch 4 times, most recently from f8d0128 to 5831aec Compare June 26, 2026 04:22
addaleax
addaleax reviewed Jun 29, 2026
View reviewed changes
Comment thread doc/api/tty.md Outdated
raw device. If `false`, configures the `tty.ReadStream` to operate in its
default mode. The `readStream.isRaw` property will be set to the resulting
mode.
* `mode` {boolean|string} If `true` or `'raw-vt'`, configures the

@addaleax addaleax Jun 29, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I would not use 'raw-vt' as a name and instead just use 'raw'. UV_TTY_MODE_RAW_VT is what UV_TTY_MODE_RAW should probably have been all along – the only reason they aren't merged (yet) into a single constant is backwards compatibility expectations in libuv.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@samuel-williams-shopify samuel-williams-shopify Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Agreed, updated.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/tty.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@samuel-williams-shopify
samuel-williams-shopify force-pushed the tty-raw-vt-io-mode branch from 5831aec to 15fdba0 Compare June 29, 2026 23:39
@samuel-williams-shopify
samuel-williams-shopify requested a review from addaleax June 29, 2026 23:42
@samuel-williams-shopify samuel-williams-shopify mentioned this pull request Jun 29, 2026
unix: return EINVAL for invalid tty modes libuv/libuv#5174
Merged
@samuel-williams-shopify

samuel-williams-shopify commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

Related libuv hardening PR: libuv/libuv#5174

That PR makes Unix uv_tty_set_mode() return UV_EINVAL for unrecognized uv_tty_mode_t values, matching the existing Windows behavior.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

addaleax
addaleax approved these changes Jun 30, 2026
View reviewed changes
@addaleax addaleax added author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Jun 30, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jun 30, 2026
@nodejs-github-bot

nodejs-github-bot commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/74448/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@samuel-williams-shopify

samuel-williams-shopify commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

I can't see the CI failures, it says access denied.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Jul 2, 2026

Copy link
Copy Markdown
Member

@samuel-williams-shopify The failures seem exclusively related to alpine:

  ...
 length differs.
expect=4
actual=7
patterns:
pattern = ^raw=true$
pattern = ^normal=false$
pattern = ^raw\-string=true$
pattern = ^io=false$
outlines:
outline = stty: standard input: Not a tty
outline = raw=true
outline = normal=false
outline = stty: standard input: Not a tty
outline = raw-string=true
outline = stty: standard input: Not a tty
outline = io=false
not ok 5141 pseudo-tty/test-set-raw-mode-modes
  ---
  duration_ms: 287.86900
  severity: fail
  stack: |-
    stty: standard input: Not a tty
    raw=true
    normal=false
    stty: standard input: Not a tty
    raw-string=true
    stty: standard input: Not a tty
    io=false
  ...

Not sure what's different on the Alpine runners, I guess if there's no obvious reason for this it might be fine to silence stderr for stty instead of specifying inherit there

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@samuel-williams-shopify

samuel-williams-shopify commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Pushed a test-only update in 7af5c59 to capture stty stderr in test-set-raw-mode-modes instead of inheriting it. This should prevent Alpine's stty: standard input: Not a tty message from polluting the pseudo-tty expected-output comparison while still surfacing stderr if stty exits non-zero.

I can't trigger or view the Jenkins run from here, and the new GitHub checks appear to be waiting for maintainer approval. Could a maintainer approve/rerun CI when convenient?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jasnell
jasnell approved these changes Jul 4, 2026
View reviewed changes
@trivikr trivikr added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jul 26, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jul 26, 2026
@nodejs-github-bot

nodejs-github-bot commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/75152/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trivikr trivikr removed the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Aug 20, 2026
@trivikr

trivikr commented Aug 20, 2026

Copy link
Copy Markdown
Member

This PR needs to a rebase to resolve conflicts in doc/api/tty.md

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

samuel-williams-shopify added 3 commits August 21, 2026 12:14
@samuel-williams-shopify
tty: add raw-vt and io raw modes
ed187ed
Signed-off-by: Samuel Williams <[email protected]>
@samuel-williams-shopify
doc: update tty raw mode PR-URL
8bbfdc4
Signed-off-by: Samuel Williams <[email protected]>
@samuel-williams-shopify
tty: use raw as public raw mode name
5da06d4
Signed-off-by: Samuel Williams <[email protected]>
@samuel-williams-shopify
test: silence stty stderr in raw mode test
f94af6e
Signed-off-by: Samuel Williams <[email protected]>
@samuel-williams-shopify
samuel-williams-shopify force-pushed the tty-raw-vt-io-mode branch from 7af5c59 to f94af6e Compare August 21, 2026 00:14
@samuel-williams-shopify

samuel-williams-shopify commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

@trivikr done.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trivikr trivikr added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Aug 22, 2026
trivikr
trivikr approved these changes Aug 22, 2026
View reviewed changes
@trivikr trivikr added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Aug 22, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Aug 22, 2026
@nodejs-github-bot

This comment was marked as resolved.

Sign in to view
@codecov

codecov Bot commented Aug 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.05882% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.11%. Comparing base (9472421) to head (f94af6e).
⚠️ Report is 64 commits behind head on main.

Files with missing lines Patch % Lines
src/tty_wrap.cc 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64140      +/-   ##
==========================================
- Coverage   90.12%   90.11%   -0.02%     
==========================================
  Files         752      752              
  Lines      252312   252338      +26     
  Branches    47432    47444      +12     
==========================================
- Hits       227404   227398       -6     
- Misses      16217    16265      +48     
+ Partials     8691     8675      -16     
Files with missing lines Coverage Δ
lib/tty.js 96.33% <100.00%> (+0.50%) ⬆️
src/tty_wrap.cc 82.27% <83.33%> (-0.62%) ⬇️

... and 32 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/76273/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trivikr trivikr added the commit-queue PRs queued for automated landing through the Commit Queue. label Aug 23, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. and removed commit-queue PRs queued for automated landing through the Commit Queue. labels Aug 23, 2026
@nodejs-github-bot

nodejs-github-bot commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Commit Queue failed

This pull request has multiple commits, but no landing policy was selected.

Add commit-queue-squash PRs the Commit Queue should land as one squashed commit. to land it as one commit, or commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. to land the commits separately.

The pull request was removed from the Commit Queue and labeled commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. . After resolving the failure, remove that label and add commit-queue PRs queued for automated landing through the Commit Queue. to retry.

Full Commit Queue output
- Loading data for nodejs/node/pull/64140
✔  Done loading data for nodejs/node/pull/64140
----------------------------------- PR info ------------------------------------
Title      tty: add raw-vt and io raw modes (#64140)
Author     Samuel Williams <[email protected]> (@samuel-williams-shopify, first-time contributor)
Branch     samuel-williams-shopify:tty-raw-vt-io-mode -> nodejs:main
Labels     c++, tty, author ready, needs-ci, commit-queue
Commits    5
 - tty: add raw-vt and io raw modes
 - doc: update tty raw mode PR-URL
 - tty: use raw as public raw mode name
 - tty: reject unknown raw mode strings
 - test: silence stty stderr in raw mode test
Committers 1
 - Samuel Williams <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/64140
Refs: https://github.com/nodejs/node/issues/63059
Refs: https://github.com/libuv/libuv/issues/32
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/64140
Refs: https://github.com/nodejs/node/issues/63059
Refs: https://github.com/libuv/libuv/issues/32
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Fri, 26 Jun 2026 04:05:37 GMT
   ✔  Approvals: 3
   ✔  - Anna Henningsen (@addaleax): https://github.com/nodejs/node/pull/64140#pullrequestreview-4599153146
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/64140#pullrequestreview-4629888278
   ✔  - Trivikram Kamat (@trivikr): https://github.com/nodejs/node/pull/64140#pullrequestreview-5000667735
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2026-08-23T05:18:11Z: https://ci.nodejs.org/job/node-test-pull-request/76273/
- Querying data for job/node-test-pull-request/76273/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
   7072d76a5c..a89fc17cce  main       -> origin/main
✔  origin/main is now up-to-date
main is out of sync with origin/main. Mismatched commits:
 - fe654d1a54 stream: reuse unexposed managed read buffers
 - a89fc17cce stream: reuse unexposed managed read buffers
--------------------------------------------------------------------------------
HEAD is now at a89fc17cce stream: reuse unexposed managed read buffers
   ✔  Reset to origin/main
- Downloading patch for 64140
From https://github.com/nodejs/node
 * branch                  refs/pull/64140/merge -> FETCH_HEAD
✔  Fetched commits as eae0ca39be9c..f94af6ec6e76
--------------------------------------------------------------------------------
[main 6ebb60c5ec] tty: add raw-vt and io raw modes
 Author: Samuel Williams <[email protected]>
 Date: Fri Jun 26 16:05:18 2026 +1200
 5 files changed, 92 insertions(+), 12 deletions(-)
 create mode 100644 test/pseudo-tty/test-set-raw-mode-modes.js
 create mode 100644 test/pseudo-tty/test-set-raw-mode-modes.out
[main 18f60e82d3] doc: update tty raw mode PR-URL
 Author: Samuel Williams <[email protected]>
 Date: Tue Jun 30 11:38:26 2026 +1200
 1 file changed, 1 insertion(+), 1 deletion(-)
[main cd13331424] tty: use raw as public raw mode name
 Author: Samuel Williams <[email protected]>
 Date: Tue Jun 30 11:38:39 2026 +1200
 4 files changed, 11 insertions(+), 11 deletions(-)
[main d68dc705ab] tty: reject unknown raw mode strings
 Author: Samuel Williams <[email protected]>
 Date: Tue Jun 30 11:39:07 2026 +1200
 2 files changed, 17 insertions(+), 1 deletion(-)
[main 347777f3e0] test: silence stty stderr in raw mode test
 Author: Samuel Williams <[email protected]>
 Date: Fri Jul 3 21:24:20 2026 +1200
 1 file changed, 3 insertions(+), 3 deletions(-)
   ✔  Patches applied
There are 5 commits in the PR. Attempting autorebase.
(node:1323) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
(Use `node --trace-deprecation ...` to show where the warning was created)
Rebasing (2/10)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
tty: add raw-vt and io raw modes

Signed-off-by: Samuel Williams <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/64140
Refs: https://github.com/nodejs/node/issues/63059
Refs: https://github.com/libuv/libuv/issues/32
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
--------------------------------------------------------------------------------
[detached HEAD 9062b86765] tty: add raw-vt and io raw modes
 Author: Samuel Williams <[email protected]>
 Date: Fri Jun 26 16:05:18 2026 +1200
 5 files changed, 92 insertions(+), 12 deletions(-)
 create mode 100644 test/pseudo-tty/test-set-raw-mode-modes.js
 create mode 100644 test/pseudo-tty/test-set-raw-mode-modes.out
Rebasing (3/10)
Rebasing (4/10)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
doc: update tty raw mode PR-URL

Signed-off-by: Samuel Williams <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/64140
Refs: https://github.com/nodejs/node/issues/63059
Refs: https://github.com/libuv/libuv/issues/32
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
--------------------------------------------------------------------------------
[detached HEAD c899fb3810] doc: update tty raw mode PR-URL
 Author: Samuel Williams <[email protected]>
 Date: Tue Jun 30 11:38:26 2026 +1200
 1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (5/10)
Rebasing (6/10)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
tty: use raw as public raw mode name

Signed-off-by: Samuel Williams <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/64140
Refs: https://github.com/nodejs/node/issues/63059
Refs: https://github.com/libuv/libuv/issues/32
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
--------------------------------------------------------------------------------
[detached HEAD b0d51a9df8] tty: use raw as public raw mode name
 Author: Samuel Williams <[email protected]>
 Date: Tue Jun 30 11:38:39 2026 +1200
 4 files changed, 11 insertions(+), 11 deletions(-)
Rebasing (7/10)
Rebasing (8/10)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
tty: reject unknown raw mode strings

Signed-off-by: Samuel Williams <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/64140
Refs: https://github.com/nodejs/node/issues/63059
Refs: https://github.com/libuv/libuv/issues/32
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
--------------------------------------------------------------------------------
[detached HEAD 994d15e30a] tty: reject unknown raw mode strings
 Author: Samuel Williams <[email protected]>
 Date: Tue Jun 30 11:39:07 2026 +1200
 2 files changed, 17 insertions(+), 1 deletion(-)
Rebasing (9/10)
Rebasing (10/10)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
test: silence stty stderr in raw mode test

Signed-off-by: Samuel Williams <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/64140
Refs: https://github.com/nodejs/node/issues/63059
Refs: https://github.com/libuv/libuv/issues/32
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
--------------------------------------------------------------------------------
[detached HEAD 9894a86a37] test: silence stty stderr in raw mode test
 Author: Samuel Williams <[email protected]>
 Date: Fri Jul 3 21:24:20 2026 +1200
 1 file changed, 3 insertions(+), 3 deletions(-)
Successfully rebased and updated refs/heads/main.
--------------------------------------------------------------------------------
   ℹ  Add `commit-queue-squash` label to land the PR as one commit, or `commit-queue-rebase` to land as separate commits.

View workflow run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trivikr trivikr added commit-queue-squash PRs the Commit Queue should land as one squashed commit. commit-queue PRs queued for automated landing through the Commit Queue. and removed commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. labels Aug 23, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 0b89f8f into nodejs:main Aug 23, 2026
88 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Landed in 0b89f8f

samuel-williams-shopify reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Aug 23, 2026
aduh95 pushed a commit that referenced this pull request Aug 25, 2026
@samuel-williams-shopify @aduh95
tty: add raw-vt and io raw modes
ecf808a
Signed-off-by: Samuel Williams <[email protected]>
PR-URL: #64140
Refs: #63059
Refs: libuv/libuv#32
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
aduh95 pushed a commit that referenced this pull request Aug 25, 2026
@samuel-williams-shopify @aduh95
tty: add raw-vt and io raw modes
cf39500
Signed-off-by: Samuel Williams <[email protected]>
PR-URL: #64140
Refs: #63059
Refs: libuv/libuv#32
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@github-actions github-actions Bot mentioned this pull request Aug 25, 2026
2026-08-26, Version 26.8.0 (Current) #65551
Merged
aduh95 pushed a commit that referenced this pull request Aug 27, 2026
@samuel-williams-shopify @aduh95
tty: add raw-vt and io raw modes
2d7e3f6
Signed-off-by: Samuel Williams <[email protected]>
PR-URL: #64140
Refs: #63059
Refs: libuv/libuv#32
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@github-actions github-actions Bot mentioned this pull request Sep 7, 2026
2026-09-08, Version 24.21.0 'Krypton' (LTS) #65873
Merged
aduh95 pushed a commit that referenced this pull request Sep 7, 2026
@samuel-williams-shopify @aduh95
tty: add raw-vt and io raw modes
079afe8
Signed-off-by: Samuel Williams <[email protected]>
PR-URL: #64140
Refs: #63059
Refs: libuv/libuv#32
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
aduh95 pushed a commit that referenced this pull request Sep 7, 2026
@samuel-williams-shopify @aduh95
tty: add raw-vt and io raw modes
600663b
Signed-off-by: Samuel Williams <[email protected]>
PR-URL: #64140
Refs: #63059
Refs: libuv/libuv#32
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@SimonSchick SimonSchick mentioned this pull request Oct 10, 2026
feat: backfill various missing node APIs DefinitelyTyped/DefinitelyTyped#75760
Open
8 tasks done
@robobun robobun mentioned this pull request Oct 29, 2026
tty: setRawMode takes 'raw' and 'io' and rejects other strings, as in Node v26.8 oven-sh/bun#47318
Open
robobun added a commit to oven-sh/bun that referenced this pull request Oct 29, 2026
@robobun
tty: setRawMode takes 'raw' and 'io' and rejects other strings, as in…
5b82b12
… Node v26.8

tty.ReadStream#setRawMode(mode) classifies `mode` as Node's lib/tty.js
does since v26.8.0 and v24.21.0 (nodejs/node#64140). 'raw' and 'io'
select a mode. Any other string throws ERR_INVALID_ARG_VALUE before the
stream is touched. Every other value goes by its truthiness. The stream
reports its mode in `rawMode`: false, 'raw' or 'io'.

'io' is libuv's UV_TTY_MODE_IO: cfmakeraw(), which also turns output
processing off. The POSIX setter already had that mode. libuv has no
such mode on Windows, so there the stream emits 'error' with ENOTSUP.

The POSIX setter folds UV_TTY_MODE_RAW_VT into UV_TTY_MODE_RAW, as
libuv does, and refuses a mode that is none of libuv's with EINVAL.
process.binding('tty_wrap') has UV_TTY_MODE_NORMAL, UV_TTY_MODE_IO and
UV_TTY_MODE_RAW_VT, and TTY#setRawMode takes its argument with ToInt32.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell approved these changes
@addaleax addaleax addaleax approved these changes
@trivikr trivikr trivikr approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash PRs the Commit Queue should land as one squashed commit. needs-ci PRs that need a full CI run. tty Issues and PRs related to the tty subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@samuel-williams-shopify @nodejs-github-bot @addaleax @trivikr @jasnell
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.