fix: use detached:true on all platforms for exec stream tests

On Windows, detached:true is needed to properly keep stdio handles
open after the parent process exits.
This commit is contained in:
Salman Muin Kayser Chishti
2025-12-08 12:35:33 +00:00
parent 894f77901e
commit bf1b64008f
@@ -19,9 +19,14 @@ if (!filePath) {
// This creates a grandchild process that holds the stdio handles open
// after this process (the child) exits
const waitScript = path.join(__dirname, 'wait-for-file.js')
const isWindows = process.platform === 'win32'
// On Windows, use detached:true to properly keep streams open
// On Unix, detached:true also works and creates a new process group
const child = childProcess.spawn(process.execPath, [waitScript, `file=${filePath}`], {
stdio: ['ignore', 'inherit', 'inherit'],
detached: process.platform !== 'win32'
detached: true,
windowsHide: true
})
// Don't wait for child to exit