-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: fixes default shell in child_process.md #14203
Conversation
Clarifies the default shell in Windows is process.env.ComSpec and that cmd.exe is only used as a fallback. Functions whose descriptions are affected include: child_process.spawn, child_process.exec, child_process.spawnsSync, and child_process.execSync. Fixes: nodejs#14156
Clarifies that the default shell in Windows is process.env.ComSpec and that cmd.exe is only used as a fallback. Functions whose descriptions are affected include: child_process.spawn, child_process.exec, child_process.spawnSync, and child_process.execSync. Fixes: nodejs#14156
Thank you! A nit: the length of some new lines is more than 80 chars now. Can you rewrap them according to our style guide? |
Rewrapped lines over 80 characters according to the Style Guide.
No problem! I rewrapped the lines in my latest commit. Thanks for the feedback! |
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 am kind of unsatisfied with having the same content four times, even though it is not too long... Still not pretty IMO.
Would a footnote be more appropriate in this situation? |
I would prefer that, maybe a small section at the bottom of the page (similar to this section)? Let's wait for another opinion on this :) |
I'll see what I can do once we get another opinion! I do like how much cleaner that solution is compared to my current commit. |
@nodejs/documentation opionions regarding the current state vs. a footnote / paragraph at the bottom? |
+1 for footnote - I think adding too much text to parameter definitions can be really confusing. |
Reorganizes `child_process` shell spawning information. Fixes: nodejs#14156
I split the shell spawn information into two sections at the bottom, Shell Requirements and Default Windows Shell. I was having a bit of trouble combining the information into one section logically, so if you have any suggestions, let me know! |
doc/api/child_process.md
Outdated
to `false` (no shell). | ||
`'/bin/sh'` on UNIX, and `'process.env.ComSpec'` on Windows. See | ||
[Shell Requirements][] and [Default Windows Shell][]. A different shell can | ||
be specified as a string. Defaults to `false` (no shell). |
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.
Any reason why you swapped the last two sentences compared to spawn
?
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.
Oh oops! That was an accident. It should be fixed in the latest commit.
doc/api/child_process.md
Outdated
@@ -1303,6 +1314,8 @@ to `stdout` although there are only 4 characters. | |||
[`child_process.spawn()`]: #child_process_child_process_spawn_command_args_options | |||
[`child_process.spawnSync()`]: #child_process_child_process_spawnsync_command_args_options | |||
[`maxBuffer` and Unicode]: #child_process_maxbuffer_and_unicode | |||
[Shell Requirements]: #child_process_shell_requirements |
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.
This and the next references are out of ASCII sort order (should be placed before the last reference).
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.
Thanks for the heads up! They should be in the correct order in the latest commit.
Small formatting fixes for shell spawning information. Fixes: nodejs#14156
The latest commit should be updated with your reviews. Let me know if you have any more comments or suggestions! Thanks for making my first pull request a very enjoyable experience! |
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.
Thank you for your efforts! 😃 I added some final nits but everything else looks great!
Don't worry, it is completely normal that non-trivial changes need to be reviewed and adapted several times. This is our way to maintain and improve the quality of our project :)
doc/api/child_process.md
Outdated
(Default: `'/bin/sh'` on UNIX, `'cmd.exe'` on Windows, The shell should | ||
understand the `-c` switch on UNIX or `/d /s /c` on Windows. On Windows, | ||
command line parsing should be compatible with `cmd.exe`.) | ||
(Default: `'/bin/sh'` on UNIX, `'process.env.ComSpec'` on Windows. See |
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.
process.env.ComSpec
is a property (variable), not a string literal, so it should not be quoted.
doc/api/child_process.md
Outdated
`'/bin/sh'` on UNIX, and `'cmd.exe'` on Windows. A different shell can be | ||
specified as a string. The shell should understand the `-c` switch on UNIX, | ||
or `/d /s /c` on Windows. Defaults to `false` (no shell). | ||
`'/bin/sh'` on UNIX, and `'process.env.ComSpec'` on Windows. A different |
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.
Same here.
doc/api/child_process.md
Outdated
(Default: `'/bin/sh'` on UNIX, `'cmd.exe'` on Windows, The shell should | ||
understand the `-c` switch on UNIX or `/d /s /c` on Windows. On Windows, | ||
command line parsing should be compatible with `cmd.exe`.) | ||
(Default: `'/bin/sh'` on UNIX, `'process.env.ComSpec'` on Windows. See |
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.
Same here.
doc/api/child_process.md
Outdated
`'/bin/sh'` on UNIX, and `'cmd.exe'` on Windows. A different shell can be | ||
specified as a string. The shell should understand the `-c` switch on UNIX, | ||
or `/d /s /c` on Windows. Defaults to `false` (no shell). | ||
`'/bin/sh'` on UNIX, and `'process.env.ComSpec'` on Windows. A different |
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.
Same here.
doc/api/child_process.md
Outdated
Although Microsoft specifies `'process.env.ComSpec'` must contain the path to | ||
`'cmd.exe'` in the root environment, child processes are not always subject to | ||
the same requirement. Thus, in `child_process` functions where a shell can be | ||
spawned, `'cmd.exe'` is used as a fallback if `'process.env.ComSpec'` is |
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.
See above.
doc/api/child_process.md
Outdated
|
||
## Default Windows Shell | ||
|
||
Although Microsoft specifies `'process.env.ComSpec'` must contain the path to |
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.
Microsoft does not specify anything regarding process.env.ComSpec
. This is just node's representation of the process environment. Actually, Microsoft only holds that assertion for the environment variable as stored in the registry. The technical background will be too complex for our docs and is not really relevant, but I would prefer %COMSPEC%
instead of process.env.ComSpec
here (and only here).
Notation changes for `process.env.ComSpec` Fixes: nodejs#14156
The references to Thank you for all your help! The level of detail you put into your feedback makes me look forward to contributing in the future! 😃 |
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.
Last nit, I swear!
doc/api/child_process.md
Outdated
|
||
## Default Windows Shell | ||
|
||
Although Microsoft specifies `%COMSPEC` must contain the path to |
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.
Environment variables must be enclosed in %
s under Windows, so it should be %COMSPEC%
(note the %
at the end).
Wrapped `%COMSPEC%` with percent signs. Fixes: nodejs#14156
Oh oops! It should be fixed now. :) |
Clarifies the default shell in Windows is process.env.ComSpec and that cmd.exe is only used as a fallback. Functions whose descriptions are affected include: child_process.spawn, child_process.exec, child_process.spawnsSync, and child_process.execSync. PR-URL: #14203 Fixes: #14156 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
Landed in 7fdcb68 🎉 Thank you very much! 😃 A few tips for future contributions:
|
Wow, my pull request landing is more exciting than I could've imagined! Thank you so much for all your help! 😃 Thank you also for the helpful tips! They answered a number of questions that I didn't quite know how to ask. :) I look forward to contributing again soon! |
Clarifies the default shell in Windows is process.env.ComSpec and that cmd.exe is only used as a fallback. Functions whose descriptions are affected include: child_process.spawn, child_process.exec, child_process.spawnsSync, and child_process.execSync. PR-URL: #14203 Fixes: #14156 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
Clarifies the default shell in Windows is process.env.ComSpec and that cmd.exe is only used as a fallback. Functions whose descriptions are affected include: child_process.spawn, child_process.exec, child_process.spawnsSync, and child_process.execSync. PR-URL: #14203 Fixes: #14156 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
is this accurate for v6.x as well? |
This PR clarifies that
'process.env.ComSpec'
is the default shell inWindows and that
'cmd.exe'
is only used as a fallback.Fixes: #14156
Checklist
Affected core subsystem(s)
doc