Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting the windowsHide option #388

Merged
merged 2 commits into from Nov 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -492,6 +492,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