Skip to content

Commit c07cce3

Browse files
TrottBridgeAR
authored andcommitted
Revert "child_process: change windowsHide default to true"
This reverts commit 420d8af. PR-URL: #24034 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
1 parent aa800b0 commit c07cce3

File tree

4 files changed

+10
-33
lines changed

4 files changed

+10
-33
lines changed

doc/api/child_process.md

+6-24
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ exec('"my script.cmd" a b', (err, stdout, stderr) => {
131131
<!-- YAML
132132
added: v0.1.90
133133
changes:
134-
- version: v11.0.0
135-
pr-url: https://github.com/nodejs/node/pull/21316
136-
description: The `windowsHide` option now defaults to `true`.
137134
- version: v8.8.0
138135
pr-url: https://github.com/nodejs/node/pull/15380
139136
description: The `windowsHide` option is supported now.
@@ -156,7 +153,7 @@ changes:
156153
* `uid` {number} Sets the user identity of the process (see setuid(2)).
157154
* `gid` {number} Sets the group identity of the process (see setgid(2)).
158155
* `windowsHide` {boolean} Hide the subprocess console window that would
159-
normally be created on Windows systems. **Default:** `true`.
156+
normally be created on Windows systems. **Default:** `false`.
160157
* `callback` {Function} called with the output when process terminates.
161158
* `error` {Error}
162159
* `stdout` {string|Buffer}
@@ -235,9 +232,6 @@ lsExample();
235232
<!-- YAML
236233
added: v0.1.91
237234
changes:
238-
- version: v11.0.0
239-
pr-url: https://github.com/nodejs/node/pull/21316
240-
description: The `windowsHide` option now defaults to `true`.
241235
- version: v8.8.0
242236
pr-url: https://github.com/nodejs/node/pull/15380
243237
description: The `windowsHide` option is supported now.
@@ -257,7 +251,7 @@ changes:
257251
* `uid` {number} Sets the user identity of the process (see setuid(2)).
258252
* `gid` {number} Sets the group identity of the process (see setgid(2)).
259253
* `windowsHide` {boolean} Hide the subprocess console window that would
260-
normally be created on Windows systems. **Default:** `true`.
254+
normally be created on Windows systems. **Default:** `false`.
261255
* `windowsVerbatimArguments` {boolean} No quoting or escaping of arguments is
262256
done on Windows. Ignored on Unix. **Default:** `false`.
263257
* `shell` {boolean|string} If `true`, runs `command` inside of a shell. Uses
@@ -381,9 +375,6 @@ The `shell` option available in [`child_process.spawn()`][] is not supported by
381375
<!-- YAML
382376
added: v0.1.90
383377
changes:
384-
- version: v11.0.0
385-
pr-url: https://github.com/nodejs/node/pull/21316
386-
description: The `windowsHide` option now defaults to `true`.
387378
- version: v8.8.0
388379
pr-url: https://github.com/nodejs/node/pull/15380
389380
description: The `windowsHide` option is supported now.
@@ -417,7 +408,7 @@ changes:
417408
done on Windows. Ignored on Unix. This is set to `true` automatically
418409
when `shell` is specified and is CMD. **Default:** `false`.
419410
* `windowsHide` {boolean} Hide the subprocess console window that would
420-
normally be created on Windows systems. **Default:** `true`.
411+
normally be created on Windows systems. **Default:** `false`.
421412
* Returns: {ChildProcess}
422413

423414
The `child_process.spawn()` method spawns a new process using the given
@@ -690,9 +681,6 @@ changes:
690681
pr-url: https://github.com/nodejs/node/pull/22409
691682
description: The `input` option can now be any `TypedArray` or a
692683
`DataView`.
693-
- version: v11.0.0
694-
pr-url: https://github.com/nodejs/node/pull/21316
695-
description: The `windowsHide` option now defaults to `true`.
696684
- version: v8.8.0
697685
pr-url: https://github.com/nodejs/node/pull/15380
698686
description: The `windowsHide` option is supported now.
@@ -727,7 +715,7 @@ changes:
727715
* `encoding` {string} The encoding used for all stdio inputs and outputs.
728716
**Default:** `'buffer'`.
729717
* `windowsHide` {boolean} Hide the subprocess console window that would
730-
normally be created on Windows systems. **Default:** `true`.
718+
normally be created on Windows systems. **Default:** `false`.
731719
* `shell` {boolean|string} If `true`, runs `command` inside of a shell. Uses
732720
`'/bin/sh'` on UNIX, and `process.env.ComSpec` on Windows. A different
733721
shell can be specified as a string. See [Shell Requirements][] and
@@ -760,9 +748,6 @@ changes:
760748
pr-url: https://github.com/nodejs/node/pull/22409
761749
description: The `input` option can now be any `TypedArray` or a
762750
`DataView`.
763-
- version: v11.0.0
764-
pr-url: https://github.com/nodejs/node/pull/21316
765-
description: The `windowsHide` option now defaults to `true`.
766751
- version: v8.8.0
767752
pr-url: https://github.com/nodejs/node/pull/15380
768753
description: The `windowsHide` option is supported now.
@@ -796,7 +781,7 @@ changes:
796781
* `encoding` {string} The encoding used for all stdio inputs and outputs.
797782
**Default:** `'buffer'`.
798783
* `windowsHide` {boolean} Hide the subprocess console window that would
799-
normally be created on Windows systems. **Default:** `true`.
784+
normally be created on Windows systems. **Default:** `false`.
800785
* Returns: {Buffer|string} The stdout from the command.
801786

802787
The `child_process.execSync()` method is generally identical to
@@ -822,9 +807,6 @@ changes:
822807
pr-url: https://github.com/nodejs/node/pull/22409
823808
description: The `input` option can now be any `TypedArray` or a
824809
`DataView`.
825-
- version: v11.0.0
826-
pr-url: https://github.com/nodejs/node/pull/21316
827-
description: The `windowsHide` option now defaults to `true`.
828810
- version: v8.8.0
829811
pr-url: https://github.com/nodejs/node/pull/15380
830812
description: The `windowsHide` option is supported now.
@@ -869,7 +851,7 @@ changes:
869851
done on Windows. Ignored on Unix. This is set to `true` automatically
870852
when `shell` is specified and is CMD. **Default:** `false`.
871853
* `windowsHide` {boolean} Hide the subprocess console window that would
872-
normally be created on Windows systems. **Default:** `true`.
854+
normally be created on Windows systems. **Default:** `false`.
873855
* Returns: {Object}
874856
* `pid` {number} Pid of the child process.
875857
* `output` {Array} Array of results from stdio output.

doc/api/cluster.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -703,9 +703,6 @@ values are `'rr'` and `'none'`.
703703
<!-- YAML
704704
added: v0.7.1
705705
changes:
706-
- version: v11.0.0
707-
pr-url: https://github.com/nodejs/node/pull/21316
708-
description: The `windowsHide` option now defaults to `true`.
709706
- version: v9.5.0
710707
pr-url: https://github.com/nodejs/node/pull/18399
711708
description: The `cwd` option is supported now.
@@ -740,7 +737,7 @@ changes:
740737
number. By default each worker gets its own port, incremented from the
741738
master's `process.debugPort`.
742739
* `windowsHide` {boolean} Hide the forked processes console window that would
743-
normally be created on Windows systems. **Default:** `true`.
740+
normally be created on Windows systems. **Default:** `false`.
744741

745742
After calling `.setupMaster()` (or `.fork()`) this settings object will contain
746743
the settings, including the default values.

lib/child_process.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ exports.execFile = function execFile(file /* , args, options, callback */) {
224224
gid: options.gid,
225225
uid: options.uid,
226226
shell: options.shell,
227-
windowsHide: options.windowsHide !== false,
227+
windowsHide: !!options.windowsHide,
228228
windowsVerbatimArguments: !!options.windowsVerbatimArguments
229229
});
230230

@@ -544,7 +544,7 @@ var spawn = exports.spawn = function spawn(/* file, args, options */) {
544544
file: opts.file,
545545
args: opts.args,
546546
cwd: options.cwd,
547-
windowsHide: options.windowsHide !== false,
547+
windowsHide: !!options.windowsHide,
548548
windowsVerbatimArguments: !!options.windowsVerbatimArguments,
549549
detached: !!options.detached,
550550
envPairs: opts.envPairs,
@@ -578,8 +578,6 @@ function spawnSync(/* file, args, options */) {
578578

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

581-
options.windowsHide = options.windowsHide !== false;
582-
583581
if (options.input) {
584582
var stdin = options.stdio[0] = util._extend({}, options.stdio[0]);
585583
stdin.input = options.input;

test/parallel/test-child-process-spawnsync-shell.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ assert.strictEqual(env.stdout.toString().trim(), 'buzz');
6767
assert.strictEqual(opts.options.shell, shell);
6868
assert.strictEqual(opts.options.file, opts.file);
6969
assert.deepStrictEqual(opts.options.args, opts.args);
70-
assert.strictEqual(opts.options.windowsHide, true);
70+
assert.strictEqual(opts.options.windowsHide, undefined);
7171
assert.strictEqual(opts.options.windowsVerbatimArguments,
7272
windowsVerbatim);
7373
});

0 commit comments

Comments
 (0)