Skip to content

Commit

Permalink
Allow setting the windowsHide option (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky authored and sindresorhus committed Nov 12, 2019
1 parent ecdbad3 commit 717d29d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
7 changes: 7 additions & 0 deletions index.d.ts
Expand Up @@ -198,6 +198,13 @@ declare namespace execa {
@default false
*/
readonly windowsVerbatimArguments?: boolean;

/**
On Windows, do not create a new console window. Please note this also prevents `CTRL-C` [from working](https://github.com/nodejs/node/issues/29837) on Windows.
@default true
*/
readonly windowsHide?: boolean;
}

interface Options<EncodingType = string> extends CommonOptions<EncodingType> {
Expand Down
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -42,8 +42,8 @@ const handleArgs = (file, args, options = {}) => {
reject: true,
cleanup: true,
all: false,
...options,
windowsHide: true
windowsHide: true,
...options
};

options.env = getEnv(options);
Expand Down
1 change: 1 addition & 0 deletions index.test-d.ts
Expand Up @@ -125,6 +125,7 @@ execa('unicorns', {maxBuffer: 1000});
execa('unicorns', {killSignal: 'SIGTERM'});
execa('unicorns', {killSignal: 9});
execa('unicorns', {windowsVerbatimArguments: true});
execa('unicorns', {windowsHide: false});
execa('unicorns').kill();
execa('unicorns').kill('SIGKILL');
execa('unicorns').kill(undefined);
Expand Down
7 changes: 7 additions & 0 deletions readme.md
Expand Up @@ -516,6 +516,13 @@ Default: `false`

If `true`, no quoting or escaping of arguments is done on Windows. Ignored on other platforms. This is set to `true` automatically when the `shell` option is `true`.

#### windowsHide

Type: `boolean`<br>
Default: `true`

On Windows, do not create a new console window. Please note this also prevents `CTRL-C` [from working](https://github.com/nodejs/node/issues/29837) on Windows.

#### nodePath *(for `.node()` only)*

Type: `string`<br>
Expand Down

0 comments on commit 717d29d

Please sign in to comment.