Skip to content

Commit

Permalink
Revert "child_process: change windowsHide default to true"
Browse files Browse the repository at this point in the history
This reverts commit 420d8af.

PR-URL: #24034
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Shelley Vohr <[email protected]>
Reviewed-By: Ujjwal Sharma <[email protected]>
Reviewed-By: Bartosz Sosnowski <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
  • Loading branch information
Trott authored and BridgeAR committed Nov 15, 2018
1 parent aa800b0 commit c07cce3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 33 deletions.
30 changes: 6 additions & 24 deletions doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,6 @@ exec('"my script.cmd" a b', (err, stdout, stderr) => {
<!-- YAML
added: v0.1.90
changes:
- version: v11.0.0
pr-url: https://github.com/nodejs/node/pull/21316
description: The `windowsHide` option now defaults to `true`.
- version: v8.8.0
pr-url: https://github.com/nodejs/node/pull/15380
description: The `windowsHide` option is supported now.
Expand All @@ -156,7 +153,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)).
* `windowsHide` {boolean} Hide the subprocess console window that would
normally be created on Windows systems. **Default:** `true`.
normally be created on Windows systems. **Default:** `false`.
* `callback` {Function} called with the output when process terminates.
* `error` {Error}
* `stdout` {string|Buffer}
Expand Down Expand Up @@ -235,9 +232,6 @@ lsExample();
<!-- YAML
added: v0.1.91
changes:
- version: v11.0.0
pr-url: https://github.com/nodejs/node/pull/21316
description: The `windowsHide` option now defaults to `true`.
- version: v8.8.0
pr-url: https://github.com/nodejs/node/pull/15380
description: The `windowsHide` option is supported now.
Expand All @@ -257,7 +251,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)).
* `windowsHide` {boolean} Hide the subprocess console window that would
normally be created on Windows systems. **Default:** `true`.
normally be created on Windows systems. **Default:** `false`.
* `windowsVerbatimArguments` {boolean} No quoting or escaping of arguments is
done on Windows. Ignored on Unix. **Default:** `false`.
* `shell` {boolean|string} If `true`, runs `command` inside of a shell. Uses
Expand Down Expand Up @@ -381,9 +375,6 @@ The `shell` option available in [`child_process.spawn()`][] is not supported by
<!-- YAML
added: v0.1.90
changes:
- version: v11.0.0
pr-url: https://github.com/nodejs/node/pull/21316
description: The `windowsHide` option now defaults to `true`.
- version: v8.8.0
pr-url: https://github.com/nodejs/node/pull/15380
description: The `windowsHide` option is supported now.
Expand Down Expand Up @@ -417,7 +408,7 @@ changes:
done on Windows. Ignored on Unix. This is set to `true` automatically
when `shell` is specified and is CMD. **Default:** `false`.
* `windowsHide` {boolean} Hide the subprocess console window that would
normally be created on Windows systems. **Default:** `true`.
normally be created on Windows systems. **Default:** `false`.
* Returns: {ChildProcess}

The `child_process.spawn()` method spawns a new process using the given
Expand Down Expand Up @@ -690,9 +681,6 @@ changes:
pr-url: https://github.com/nodejs/node/pull/22409
description: The `input` option can now be any `TypedArray` or a
`DataView`.
- version: v11.0.0
pr-url: https://github.com/nodejs/node/pull/21316
description: The `windowsHide` option now defaults to `true`.
- version: v8.8.0
pr-url: https://github.com/nodejs/node/pull/15380
description: The `windowsHide` option is supported now.
Expand Down Expand Up @@ -727,7 +715,7 @@ changes:
* `encoding` {string} The encoding used for all stdio inputs and outputs.
**Default:** `'buffer'`.
* `windowsHide` {boolean} Hide the subprocess console window that would
normally be created on Windows systems. **Default:** `true`.
normally be created on Windows systems. **Default:** `false`.
* `shell` {boolean|string} If `true`, runs `command` inside of a shell. Uses
`'/bin/sh'` on UNIX, and `process.env.ComSpec` on Windows. A different
shell can be specified as a string. See [Shell Requirements][] and
Expand Down Expand Up @@ -760,9 +748,6 @@ changes:
pr-url: https://github.com/nodejs/node/pull/22409
description: The `input` option can now be any `TypedArray` or a
`DataView`.
- version: v11.0.0
pr-url: https://github.com/nodejs/node/pull/21316
description: The `windowsHide` option now defaults to `true`.
- version: v8.8.0
pr-url: https://github.com/nodejs/node/pull/15380
description: The `windowsHide` option is supported now.
Expand Down Expand Up @@ -796,7 +781,7 @@ changes:
* `encoding` {string} The encoding used for all stdio inputs and outputs.
**Default:** `'buffer'`.
* `windowsHide` {boolean} Hide the subprocess console window that would
normally be created on Windows systems. **Default:** `true`.
normally be created on Windows systems. **Default:** `false`.
* Returns: {Buffer|string} The stdout from the command.

The `child_process.execSync()` method is generally identical to
Expand All @@ -822,9 +807,6 @@ changes:
pr-url: https://github.com/nodejs/node/pull/22409
description: The `input` option can now be any `TypedArray` or a
`DataView`.
- version: v11.0.0
pr-url: https://github.com/nodejs/node/pull/21316
description: The `windowsHide` option now defaults to `true`.
- version: v8.8.0
pr-url: https://github.com/nodejs/node/pull/15380
description: The `windowsHide` option is supported now.
Expand Down Expand Up @@ -869,7 +851,7 @@ changes:
done on Windows. Ignored on Unix. This is set to `true` automatically
when `shell` is specified and is CMD. **Default:** `false`.
* `windowsHide` {boolean} Hide the subprocess console window that would
normally be created on Windows systems. **Default:** `true`.
normally be created on Windows systems. **Default:** `false`.
* Returns: {Object}
* `pid` {number} Pid of the child process.
* `output` {Array} Array of results from stdio output.
Expand Down
5 changes: 1 addition & 4 deletions doc/api/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,6 @@ values are `'rr'` and `'none'`.
<!-- YAML
added: v0.7.1
changes:
- version: v11.0.0
pr-url: https://github.com/nodejs/node/pull/21316
description: The `windowsHide` option now defaults to `true`.
- version: v9.5.0
pr-url: https://github.com/nodejs/node/pull/18399
description: The `cwd` option is supported now.
Expand Down Expand Up @@ -740,7 +737,7 @@ changes:
number. By default each worker gets its own port, incremented from the
master's `process.debugPort`.
* `windowsHide` {boolean} Hide the forked processes console window that would
normally be created on Windows systems. **Default:** `true`.
normally be created on Windows systems. **Default:** `false`.

After calling `.setupMaster()` (or `.fork()`) this settings object will contain
the settings, including the default values.
Expand Down
6 changes: 2 additions & 4 deletions lib/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ exports.execFile = function execFile(file /* , args, options, callback */) {
gid: options.gid,
uid: options.uid,
shell: options.shell,
windowsHide: options.windowsHide !== false,
windowsHide: !!options.windowsHide,
windowsVerbatimArguments: !!options.windowsVerbatimArguments
});

Expand Down Expand Up @@ -544,7 +544,7 @@ var spawn = exports.spawn = function spawn(/* file, args, options */) {
file: opts.file,
args: opts.args,
cwd: options.cwd,
windowsHide: options.windowsHide !== false,
windowsHide: !!options.windowsHide,
windowsVerbatimArguments: !!options.windowsVerbatimArguments,
detached: !!options.detached,
envPairs: opts.envPairs,
Expand Down Expand Up @@ -578,8 +578,6 @@ function spawnSync(/* file, args, options */) {

options.stdio = _validateStdio(options.stdio || 'pipe', true).stdio;

options.windowsHide = options.windowsHide !== false;

if (options.input) {
var stdin = options.stdio[0] = util._extend({}, options.stdio[0]);
stdin.input = options.input;
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-child-process-spawnsync-shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ assert.strictEqual(env.stdout.toString().trim(), 'buzz');
assert.strictEqual(opts.options.shell, shell);
assert.strictEqual(opts.options.file, opts.file);
assert.deepStrictEqual(opts.options.args, opts.args);
assert.strictEqual(opts.options.windowsHide, true);
assert.strictEqual(opts.options.windowsHide, undefined);
assert.strictEqual(opts.options.windowsVerbatimArguments,
windowsVerbatim);
});
Expand Down

0 comments on commit c07cce3

Please sign in to comment.