diff --git a/index.d.ts b/index.d.ts index a615237deb..816c7fd920 100644 --- a/index.d.ts +++ b/index.d.ts @@ -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 extends CommonOptions { diff --git a/index.js b/index.js index 4e691ef9dd..731e190348 100644 --- a/index.js +++ b/index.js @@ -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); diff --git a/index.test-d.ts b/index.test-d.ts index 8d5a5fbc86..7a2e7ea6f6 100644 --- a/index.test-d.ts +++ b/index.test-d.ts @@ -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); diff --git a/readme.md b/readme.md index 0cfc645f5c..ee775b667d 100644 --- a/readme.md +++ b/readme.md @@ -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`
+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`