Skip to content

Commit

Permalink
doc: fixes default shell in child_process.md
Browse files Browse the repository at this point in the history
Notation changes for `process.env.ComSpec`

Fixes: nodejs#14156
  • Loading branch information
henryzxu committed Jul 18, 2017
1 parent 33adbeb commit e4171c3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ 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, `'process.env.ComSpec'` on Windows. See
(Default: `'/bin/sh'` on UNIX, `process.env.ComSpec` on Windows. See
[Shell Requirements][] and [Default Windows Shell][].)
* `timeout` {number} (Default: `0`)
* `maxBuffer` {number} Largest amount of data in bytes allowed on stdout or
Expand Down Expand Up @@ -381,7 +381,7 @@ 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 `'process.env.ComSpec'` on Windows. A different
`'/bin/sh'` on UNIX, and `process.env.ComSpec` on Windows. A different
shell can be specified as a string. See [Shell Requirements][] and
[Default Windows Shell][]. Defaults to `false` (no shell).
* Returns: {ChildProcess}
Expand Down Expand Up @@ -706,7 +706,7 @@ changes:
`stdio` is specified
* `env` {Object} Environment key-value pairs
* `shell` {string} Shell to execute the command with
(Default: `'/bin/sh'` on UNIX, `'process.env.ComSpec'` on Windows. See
(Default: `'/bin/sh'` on UNIX, `process.env.ComSpec` on Windows. See
[Shell Requirements][] and [Default Windows Shell][].)
* `uid` {number} Sets the user identity of the process. (See setuid(2).)
* `gid` {number} Sets the group identity of the process. (See setgid(2).)
Expand Down Expand Up @@ -773,7 +773,7 @@ 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 `'process.env.ComSpec'` on Windows. A different
`'/bin/sh'` on UNIX, and `process.env.ComSpec` on Windows. A different
shell can be specified as a string. See [Shell Requirements][] and
[Default Windows Shell][]. Defaults to `false` (no shell).
* Returns: {Object}
Expand Down Expand Up @@ -1286,10 +1286,10 @@ On Windows, command line parsing should be compatible with `'cmd.exe'`.

## Default Windows Shell

Although Microsoft specifies `'process.env.ComSpec'` must contain the path to
Although Microsoft specifies `%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
spawned, `'cmd.exe'` is used as a fallback if `process.env.ComSpec` is
unavailable.

[`'error'`]: #child_process_event_error
Expand Down

0 comments on commit e4171c3

Please sign in to comment.