You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
child_process - windowsHide not working with detached: true #21825
Removing detached makes everything work just fine. But the command wont run if the parent dies, which is something I don't want in the actual scenario.
Reacted by BJR Matos, Gerald Warner, Toru Nagashima, Krzysztof Zegzula, Akila Bandara, Jarred Sumner, Ivan Borshchov, David Luzar, shine and Flawid D'Souza
I have the same problem.
In the below example, I want to respawn a node process with detached = true which will spawn another process of procdump. In this case, the window is popping out and I don't want this happening.
I've put windowsHide flag on true but is not working.
Could you please help me?
Example:
==nodeSpawn.js file
let child_process = require("child_process");
const nodePath = "C:\Program Files\nodejs\node.exe";
child_process.spawn(nodePath,['procDumpSpawn.js'],{
detached: true, //=>is working without detached true
stdio: 'ignore',
shell: false,
windowsHide: true
});
same thing here on node v10.14.2
i am using spawn to launch external exe (rethinkdb) with detached = true, and console window is popping up even windowsHide is set to true.
is there any workaround for this?
per bzoz's comment, the original issue seems to be due to spawning a script, but if spawning an exe it shall be okay, but for my case i was indeed spawning an exe as well.
just as side note, if i use execFile there was no pop up, but i need to use spawn in order to have detacted option (because i want to prevent SIGINT from passing down to child process)
Activity
bzoz commentedon Jul 18, 2018
It looks like it is because
npm.cmdis a shell script. So it gets a shell with a window. This code, which runsnpmjs file directly:acts as expected, no window is spawned.
corneliuc commentedon Jul 19, 2018
Hello,
I have the same problem.
In the below example, I want to respawn a node process with detached = true which will spawn another process of procdump. In this case, the window is popping out and I don't want this happening.
I've put windowsHide flag on true but is not working.
Could you please help me?
Example:
==nodeSpawn.js file
let child_process = require("child_process");
const nodePath = "C:\Program Files\nodejs\node.exe";
child_process.spawn(nodePath,['procDumpSpawn.js'],{
detached: true, //=>is working without detached true
stdio: 'ignore',
shell: false,
windowsHide: true
});
==procDumpSpawn.js file
let child_process = require("child_process");
const procDumpPath = "C:\procdump.exe";
child_process.spawn(procDumpPath, ['notepad'],{
stdio: 'ignore',
});
Run: node nodeSpawn.js
Corneliu,
ledmirage commentedon Dec 28, 2018
same thing here on node v10.14.2
i am using spawn to launch external exe (rethinkdb) with detached = true, and console window is popping up even windowsHide is set to true.
is there any workaround for this?
ryzokuken commentedon Dec 29, 2018
/cc @nodejs/platform-windows @bzoz is this expected behavior?
seishun commentedon Dec 29, 2018
Seems to be the expected behavior per @bzoz's comment.
ledmirage commentedon Dec 29, 2018
per bzoz's comment, the original issue seems to be due to spawning a script, but if spawning an exe it shall be okay, but for my case i was indeed spawning an exe as well.
just as side note, if i use execFile there was no pop up, but i need to use spawn in order to have detacted option (because i want to prevent SIGINT from passing down to child process)
bzoz commentedon Jan 2, 2019
@ledmirage use
shell: falseoptionledmirage commentedon Jan 3, 2019
@bzoz tried that as well, but the pop up is still there
i am testing on Windows 10.
this is the code snippet:
const subprocess = child_process.spawn(cmd, args, {
detached: true
, stdio: 'ignore'
, shell: false
});
bzoz commentedon Jan 3, 2019
@ledmirage: what is your exact Node version and what exactly are you trying to run?
ledmirage commentedon Jan 6, 2019
@bzoz i tried node 10.15 for windows
as mentioned i was running rethinkdb.exe (https://rethinkdb.com/docs/install/windows/)
bzoz commentedon Jan 7, 2019
Looks like this
rethinkdbjust needs some console for output. If you setstdiooption toinheritorpipethe window will not appear.Anyway, all this should be documented and added to
windowHideoption description.ledmirage commentedon Jan 8, 2019
@bzoz tried both inherit and pipe and together with windowsHide = true, still no luck
i will probably just accept this for now if no workaround
bzoz commentedon Jan 8, 2019
@ledmirage sorry to hear that. It worked for me though, maybe there is something in your app that affects this?
Could you verify that a simple script with only the spawn command still exibits this behavior?
22 remaining items
fix: Windows console popup issue using PowerShell workaround
fix: Windows console popup issue using PowerShell workaround
Fix Windows console window flash on daemon spawn
fix: Windows console popup issue using PowerShell workaround
fix(warm-pool): kill the entire gemini process group on shutdown (#100)
fix(sdlc-workflow): harden tray per CodeRabbit review
sdlc-workflow: release 9.45.0 — self-contained build (retire runtime …
fix(sdlc-workflow): harden tray per CodeRabbit review
fix(installer/win): self-detach 콘솔 창 진짜 원인 제거 — detached:true가 window…
fix(tui): spawn daemon via pythonw.exe to avoid console window flash
fix(tui): spawn daemon via pythonw.exe to avoid console window flash
fix(env): stop Windows popup, cheapen venv poll
fix: stop the Windows background agent from popping a console window
fix(wsl+mpi+review): no console windows on Windows + sequential RELIO…
desktop: fix vite/backend spawn bugs found during verification, add v…