Skip to content

doc: setRawMode needs write permission on Windows - #63856

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
edemaine:tty-rw
Aug 18, 2026
Merged

doc: setRawMode needs write permission on Windows#63856
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
edemaine:tty-rw

Conversation

@edemaine

@edemaine edemaine commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #63852. After reporting that issue, I realized that this is probably how Windows is supposed to work, and I just needed to open the console with better permissions. This PR documents this solution so that others can figure this out more easily.

Summary of changes

Document that tty.ReadStream#setRawMode() on Windows requires write access to the console input buffer.

When opening "\\\\.\\CONIN$" with the fs.open() family of APIs, a read-only flag such as 'r' allows creating a readable TTY stream, but setRawMode() fails because Windows needs write permission to update the console mode. Recommend using a read/write flag such as 'r+'.

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. tty Issues and PRs related to the tty subsystem. labels Jun 11, 2026
Fixes: nodejs#63852
Signed-off-by: Erik Demaine <edemaine@mit.edu>
@trivikr trivikr added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 18, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 16c06b8 into nodejs:main Aug 18, 2026
18 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 16c06b8

@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Issues and PRs related to the documentations. tty Issues and PRs related to the tty subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: no supported way to reopen console input (CONIN$) as a raw tty.ReadStream when stdin is a pipe

4 participants