Repository navigation
doc: readline on "Git Bash" - winpty required #14100
Description
Activity
- changed the title
[-]readline: Process don't terminate after readline.close()[/-][+]readline: process don't terminate after readline.close()[/+]on Jul 6, 2017 - addedreadlineIssues and PRs related to the built-in readline module.Issues and PRs related to the built-in readline module.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
on Jul 6, 2017 FWIW, I can not reproduce the issue on Windows with v4, v6, v8 or v9.
This only happens in Git Bash.
In PowerShell or cmd, It's fine.cc @nodejs/platform-windows, @addaleax, @Fishrock123
I can repoduce this. A similar and probably related problem occurs when executing
node.exewithout arguments, which should normally start the built-in repl, but does not under Git Bash.node.exe -istarts the repl, so I assume the console / tty configuration does not work correctly in Git Bash.Reacted by Weijia WangSomeone told me Node.js supported building only with
cmd.exeon Windows. I am not sure if we support test runs in other shells or work in other shells at all(This looks like a duplicate of #5620 .
Please always use
winptywhen running Node on Git Bash. Actually, if you run justnode, Git Bash will addwinptyfor you. But if you runnode.exe, a different file name or with a path, you have to usewinpty. Try:winpty node.exe script.js- addeddocIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.
on Jul 6, 2017 Please always use winpty when running Node on Git Bash.
So I'd suggest we document this, but also disclaim official support (Experimental / YMMV) for: Git Bash / MSYS / MinGW / Cygwin / WSL
- changed the title
[-]readline: process don't terminate after readline.close()[/-][+]doc: readline on "Git Bash" - process don't terminate after `readline.close()` - `winpty` required[/+]on Jul 6, 2017 - changed the title
[-]doc: readline on "Git Bash" - process don't terminate after `readline.close()` - `winpty` required[/-][+]doc: readline on "Git Bash" - process doesn't terminate after `readline.close()` - `winpty` required[/+]on Jul 6, 2017 - changed the title
[-]doc: readline on "Git Bash" - process doesn't terminate after `readline.close()` - `winpty` required[/-][+]doc: readline on "Git Bash" - `winpty` required[/+]on Jul 6, 2017 Your test case is effectively:
process.stdin.resume(); process.stdin.pause();
When running in Git Bash, GetFileType on stdin returns FILE_TYPE_PIPE rather than FILE_TYPE_CHAR. Consequently, Node.js doesn't consider it a TTY and sets its
highWaterMarkto the default value of16384, rather than0as in cmd.Once you're resumed a stream, it will read until it has read
highWaterMarkbytes or EOF. Pausing only takes action after a chunk is read. So in your case, the process will exit once you enter 16384 bytes or EOF.I say we close this since Git Bash is not supported. We can create a separate issue for documentation.
3 remaining items
@refack @starkwang I could document that. Can you please point me as to where that would need to be added?
The only place that mentions platform support seems to be
node/deps/uv/SUPPORTED_PLATFORMS.md- would that be the right place to add this info?@yamalight the place we document our platform support is here: https://github.com/nodejs/node/blob/master/BUILDING.md#supported-platforms-1
Not sure what @refack had in mind, but I'd assume something like adding a
note2to the Windows section to say that running throughcmdis supported, but running through any other shell is experimental (and then mentionwinptyfor Git Bash and Cygwin).@gibfahn thanks, got it. Will make a PR soon 👍
PR created. Please let me know if you want any changes.
- addedwipIssues and PRs that are still a work in progress.Issues and PRs that are still a work in progress.and removedgood first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
on Oct 10, 2017 - added a commit that references this issue
on Oct 15, 2017 - added 2 commits that reference this issue
on Oct 18, 2017 - added 3 commits that reference this issue
on Nov 16, 2017 - added a commit that references this issue
on Jul 27, 2026
On Windows7, the Node.js application don't terminate after
rl.close():It causes test/parallel/test-readline-interface.js TIMEOUT, which will not happen in v6.x.x