Skip to content

Commit

Permalink
doc: fixes default shell in child_process.md
Browse files Browse the repository at this point in the history
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
  • Loading branch information
henryzxu committed Jul 12, 2017
1 parent f52c707 commit 1a07c2a
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions doc/api/child_process.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Child Process
# Child Process

> Stability: 2 - Stable
Expand Down Expand Up @@ -133,9 +133,10 @@ added: v0.1.90
* `env` {Object} Environment key-value pairs
* `encoding` {string} (Default: `'utf8'`)
* `shell` {string} Shell to execute the command with
(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. If
`'process.env.ComSpec'` is unavailable, uses `'cmd.exe'` on Windows instead.
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`.)
* `timeout` {number} (Default: `0`)
* `maxBuffer` {number} Largest amount of data in bytes allowed on stdout or
stderr. (Default: `200*1024`) If exceeded, the child process is terminated.
Expand Down Expand Up @@ -382,9 +383,10 @@ changes:
* `uid` {number} Sets the user identity of the process. (See setuid(2).)
* `gid` {number} Sets the group identity of the process. (See setgid(2).)
* `shell` {boolean|string} If `true`, runs `command` inside of a shell. Uses
`'/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. If
`'process.env.ComSpec'` is unavailable, uses `'cmd.exe'` on Windows instead.
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).
* Returns: {ChildProcess}

The `child_process.spawn()` method spawns a new process using the given
Expand Down Expand Up @@ -707,9 +709,10 @@ changes:
`stdio` is specified
* `env` {Object} Environment key-value pairs
* `shell` {string} Shell to execute the command with
(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.
If `'process.env.ComSpec'` is unavailable, uses `'cmd.exe'` on Windows instead.
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`.)
* `uid` {number} Sets the user identity of the process. (See setuid(2).)
* `gid` {number} Sets the group identity of the process. (See setgid(2).)
* `timeout` {number} In milliseconds the maximum amount of time the process
Expand Down Expand Up @@ -775,9 +778,10 @@ changes:
* `encoding` {string} The encoding used for all stdio inputs and outputs.
(Default: `'buffer'`)
* `shell` {boolean|string} If `true`, runs `command` inside of a shell. Uses
`'/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. If
`'process.env.ComSpec'` is unavailable, uses `'cmd.exe'` on Windows instead.
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).
* Returns: {Object}
* `pid` {number} Pid of the child process
* `output` {Array} Array of results from stdio output
Expand Down

0 comments on commit 1a07c2a

Please sign in to comment.