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 committed 2025-12-08 12:35:33 +00:00
1 parent 339756c0b9
commit e356b02b96
1 file changed
+6 -1
+6 -1
View File
@@ -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