diff --git a/index.js b/index.js index 6c4cc0f..708a5f8 100644 --- a/index.js +++ b/index.js @@ -61,6 +61,10 @@ module.exports = (target, opts) => { // `xdg-open` will block the process unless // stdio is ignored even if it's unref'd cpOpts.stdio = 'ignore'; + // `xdg-open` will NOT stay running in the background after + // the parent exits unless it is detached from the parent AND it + // ignores the parent's stdio file descriptor + cpOpts.detached = true; } } diff --git a/readme.md b/readme.md index 5357d44..4e7f663 100644 --- a/readme.md +++ b/readme.md @@ -65,7 +65,7 @@ Type: `Object` Type: `boolean`
Default: `true` -Wait for the opened app to exit before fulfilling the promise. If `false` it's fulfilled immediately when opening the app. +Wait for the opened app to exit before fulfilling the promise. If `false` it's fulfilled immediately when opening the app, and the app is completely detached from the node process that spawned it. On Windows you have to explicitly specify an app for it to be able to wait.