-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: document windows shell support #16104
Conversation
Adds list of supported Windows shells and explains that Git Bash and Cygwin require winpty to work correctly. Fixes: #14100
Some additions to consider:
|
cc/ @nodejs/platform-windows
Agreed, including the
Agreed |
Add simple example of winpty usage and clarify that it gets installed along with Git for Windows automatically.
@vsemozhetbyt @gibfahn added! please have a look and let me know if there are any other changes you want. |
What about powershell? Is that officially supported or not? (I would hope so, I need to tell almost everyone to at least use it on Windows rather than |
@Fishrock123 just tried running example snippet from ticket in powershell - it works OK. Interactive CLI also works fine (doesn't work on e.g. WSL without winpty). |
BUILDING.md
Outdated
note2 - Running Node.js on Windows is officially supported using Cmd. Running Node.js | ||
through any other Windows shell (e.g. WSL, Git Bash, Cygwin, etc) is experimental. | ||
Please note that running Node.js through Git Bash and Cygwin requires usage of [winpty](https://github.com/rprichard/winpty) (installed with Git for Windows) for Node.js to work | ||
correctly (e.g. `winpty node.exe script.js`). |
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'd add something like:
If you call node without the
.exe
extension,winpty
is used automatically.
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.
@gibfahn that'd only be within git for windows, right?
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.
Yes.
BTW Git for Windows
=== Git Bash
, so maybe just use the latter for clarity.
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.
@gibfahn alright, got it. let me add that..
Has anybody tried to build and run tests in powershell? |
Added info on Git Bash running winpty automatically when running node without .exe extension. Changed "Git for Windows" to "Git Bash" for clarity.
I think @refack was rewriting
Interesting, possibly something we should look at. |
@gibfahn should I open a ticket about it (interactive CLI not working on WSL)? |
I'd wait and see how this PR pans out. At the moment we don't officially support WSL. |
BUILDING.md
Outdated
@@ -59,6 +59,13 @@ note1 - The gcc4.8-libs package needs to be installed, because node | |||
by Joyent. SmartOS images >= 16.4 are not supported because | |||
GCC 4.8 runtime libraries are not available in their pkgsrc repository | |||
|
|||
note2 - Running Node.js on Windows is officially supported using Cmd. Running Node.js |
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 think I understand the place this is coming from, but it's a way to complicated scenario to try to boil down to a Note...
For instance there's also PowerShell
which is supported, WSL
is a complete different animal (and is it Ubuntu
or OpenSuse
). Also it's completely Ok to run node
without a shell (directly from a Windows app or via ❖Win + r
).
Then there's the whole Git for Windows
=== Git Bash
=== MSYS
~== MinGW
naming kerfuffle...
And as for terminal emulators, AFAIK winpty
is only needed when using mintty
. I don't know what happens when running MSYS Bash
in Console2
or ComEmu
...
tl;dr IMHO this should go in a different section with a simpler explanation of why winpty
is needed and and which scenarios, and omit the "Officially supported" sentence since that's hard to define, and the sentence above is probably not the most correct approximation (for instance we CI on headless MSYS Bash
but via python
that traps the stdio
file handlers).
Hello @yamalight, first of all welcome and thank you for the contribution 🥇 You've hit a complicated scenario, and I'm not sure the note in it's current form is the best way to approach this... |
@refack well, that issue was marked "good first contribution" 😂 but yeah, that doesn't seem to be quite as simple as it was outlined within the issue. |
|
I think this is better than what we had before (nothing), so I'm +1 on landing it and iterating. Agreed that it's very complex. |
I'd go with a minimal affirmative statement: *Note*: Running node in windows terminal emulators like `mintty` requires the usage of
[winpty](https://github.com/rprichard/winpty) for node's tty channels to work correctly
(e.g. `winpty node.exe script.js`). In "Git bash" if you call the node shell wrapper
(`node` without the `.exe` extension), `winpty` is used automatically. P.S. We now tend to use |
Simplify the explanation of node usage through non-standard windows shells.
@refack alright, changed that. Please check! |
BUILDING.md
Outdated
@@ -59,6 +59,12 @@ note1 - The gcc4.8-libs package needs to be installed, because node | |||
by Joyent. SmartOS images >= 16.4 are not supported because | |||
GCC 4.8 runtime libraries are not available in their pkgsrc repository | |||
|
|||
*Note*: Running node in windows terminal emulators like `mintty` requires the |
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.
Just to clarify that this is only in regards to Windows, I'd change it to:
*Note*: On Windows, when running node in terminal emulators like...
Thanks for following up! If you haven't already, it's recommended you take a look at CONTRIBUTING.md guide (especialy the part about "discuss and update"). Customarily PRs are kept open for at least 48 hour so that anyone interested gets a chance to comment or review. P.S. If you have any question you can also feel free to contact me directly, here or on IRC |
Simple clarification that note about mintty and winpty is only relevant when running Node.js on Windows
@refack got it. thanks for the guidance :) |
requires the usage of [winpty](https://github.com/rprichard/winpty) for | ||
Node's tty channels to work correctly (e.g. `winpty node.exe script.js`). | ||
In "Git bash" if you call the node shell wrapper (`node` without the `.exe` | ||
extension), `winpty` is used automatically. |
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'd avoid adding this note because this is an implementation detail of "Git Bash" that could change anytime.
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.
But it's also a really odd thing that isn't documented anywhere else, and the difference between node
and node.exe
is very unobvious.
I think it's worth documenting that if you're on Git Bash, you should just use node
without the .exe
to get the required behaviour, so far I've only seen it documented in Github comments (including by you 😁 ) , e.g. #5620 (comment) and #3006 (comment).
this is an implementation detail of "Git Bash" that could change anytime.
🤷♂️ , if it changes we can change the docs, but I wouldn't call it an implementation detail, this is an alias Git Bash
added to make life easier for Node users.
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'm ambivalent. I had both arguments in my head ("GfW quirk" vs. "Undocumented helper")...
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.
so, what's the final decision here? any changes needed from my side?
I personally think that it'd be better to mention it now and change later if needed, for all it's worth.
@seishun I'm considering your comment as non-blocking, ok? Linter: https://ci.nodejs.org/job/node-test-linter/12504/ ✔️ |
explain that Git Bash and Cygwin require winpty to work correctly. Added info on Git Bash running winpty automatically when running node without .exe extension. PR-URL: #16104 Fixes: #14100 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Landed in 641ba5e @yamalight congratulations on getting promoted from: |
explain that Git Bash and Cygwin require winpty to work correctly. Added info on Git Bash running winpty automatically when running node without .exe extension. PR-URL: nodejs/node#16104 Fixes: nodejs/node#14100 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
explain that Git Bash and Cygwin require winpty to work correctly. Added info on Git Bash running winpty automatically when running node without .exe extension. PR-URL: #16104 Fixes: #14100 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
explain that Git Bash and Cygwin require winpty to work correctly. Added info on Git Bash running winpty automatically when running node without .exe extension. PR-URL: #16104 Fixes: #14100 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
explain that Git Bash and Cygwin require winpty to work correctly. Added info on Git Bash running winpty automatically when running node without .exe extension. PR-URL: #16104 Fixes: #14100 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
explain that Git Bash and Cygwin require winpty to work correctly. Added info on Git Bash running winpty automatically when running node without .exe extension. PR-URL: #16104 Fixes: #14100 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
explain that Git Bash and Cygwin require winpty to work correctly. Added info on Git Bash running winpty automatically when running node without .exe extension. PR-URL: #16104 Fixes: #14100 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Checklist
make -j4 test
(UNIX)Affected core subsystem(s)
doc
Fixes: #14100