From 1a07c2a57ee449883bd5e75b24059b7cf74aef81 Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 12 Jul 2017 14:53:23 -0400 Subject: [PATCH] doc: fixes default shell in child_process.md 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: https://github.com/nodejs/node/issues/14156 --- doc/api/child_process.md | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/doc/api/child_process.md b/doc/api/child_process.md index a834f5151e25a1..157b35cabe4ba6 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -1,4 +1,4 @@ -# Child Process +# Child Process > Stability: 2 - Stable @@ -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. @@ -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 @@ -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 @@ -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