Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
child_process: add windowsHide option#15380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Conversation
cjihrig commented Sep 13, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
src/process_wrap.cc Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should ideally use the overload that takes a Local<Context> but OTOH, all the other options don't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bnoordhuis I'll submit a follow up PR to switch all of the options to use the context.
src/spawn_sync.cc Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise.
jasnell left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with docs
bzoz commented Sep 13, 2017
It looks like the original issue is Unitech/pm2#2182 - console window pops-out when starting Node.js through PM2. Based on #7653 I added This PR does not fix that issue, the console window still pops up with |
vmarchaud commented Sep 13, 2017
@bzoz From what i remember while working on this issue (one year ago already), the "fork mode" using |
cjihrig commented Sep 13, 2017
@bzoz is there any value in me keeping this open then? |
bzoz commented Sep 14, 2017
@vmarchaud hm, I observed the window popping out for a split-second when using @cjihrig I think we should keep this open. At least until we verify what is the exact issue here. |
BridgeAR commented Sep 21, 2017
@bzoz would you be so kind look into this issue further and assign this to yourself? It seems like you know what you have to look for and keeping a issue open to maybe look into something later on is not the best way to handle it ;-) |
bzoz commented Sep 22, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
There is discussion going on in #15217 about this |
BridgeAR commented Sep 22, 2017
@bzoz thanks for pointing this out. |
sam-github commented Sep 24, 2017
I completely failed to figure out the specific conditions under which console windows pop up, much less that this flag prevents it, when I tried (see #2908 (comment)), but people do report this issue, its annoying, and would be great to have a fix for. |
The existing UV_PROCESS_WINDOWS_HIDE flag only applies to executables linked to the WINDOWS subsystem. This allows CONSOLE subsystem applications to pop up a console window. This commit sets the CREATE_NO_WINDOW process flag when UV_PROCESS_WINDOWS_HIDE to prevent this behavior. Refs: nodejs/node#15380 Refs: joyent/libuv#627 Refs: libuv#965 PR-URL: libuv#1558 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Bartosz Sosnowski <[email protected]>
cjihrig commented Sep 26, 2017
This should be fixed by the next libuv update. |
refack commented Sep 26, 2017
As @bzoz writes in #15217 (comment) constassert=require('assert');constcp=require('child_process');{constbat=cp.spawn('cmd.exe',['/k','test.cmd'],{stdio: 'ignore',detached: true,windowsHide: true});bat.on('exit',(code)=>{console.log(`Child exited with code ${code}`);});} |
cjihrig commented Sep 26, 2017
@refack it seems like there are two problems:
|
refack commented Sep 26, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
|
tniessen commented Sep 26, 2017
I would prefer to prefix Windows-specific options with |
sam-github commented Sep 27, 2017
Fwiw, I'm OK with just |
refack commented Sep 27, 2017
If this will forever be a WIN32 only flag, we already have |
cjihrig commented Sep 27, 2017
I agree with @refack. In fact, I picked the name |
Refs: nodejs#15380 Refs: nodejs#15683Fixes: nodejs#15394Fixes: nodejs#15770 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]>
cjihrig commented Oct 24, 2017
Backport in #16425. The issue was that a change to the internals of |
Refs: nodejs#15380 PR-URL: nodejs#16247 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
Refs: nodejs#15380 PR-URL: nodejs#16247 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
In spawn_sync.cc, two consecutive loops are used to convert data to strings, and compute the size of the data. This commit merges the two independent loops into one. Refs: nodejs#15380 PR-URL: nodejs#16247 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit exposes the UV_PROCESS_WINDOWS_HIDE flag in Node as a windowsHide option to the child_process methods. The option is only applicable to Windows, and is ignored elsewhere. Backport-PR-URL: #16425Fixes: #15217 PR-URL: #15380 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
Backport-PR-URL: #16426 Refs: #15380 PR-URL: #16247 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
Backport-PR-URL: #16426 Refs: #15380 PR-URL: #16247 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
In spawn_sync.cc, two consecutive loops are used to convert data to strings, and compute the size of the data. This commit merges the two independent loops into one. Backport-PR-URL: #16426 Refs: #15380 PR-URL: #16247 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #15745 Refs: #15380 Refs: #15683Fixes: #15394Fixes: #15770 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]>
Refs: nodejs/node#15380 PR-URL: nodejs/node#16247 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
Refs: nodejs/node#15380 PR-URL: nodejs/node#16247 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
In spawn_sync.cc, two consecutive loops are used to convert data to strings, and compute the size of the data. This commit merges the two independent loops into one. Refs: nodejs/node#15380 PR-URL: nodejs/node#16247 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
MylesBorins commented Nov 16, 2017
Should this be backported to |
bnoordhuis commented Nov 16, 2017
In light of libuv/libuv#1625, currently not well-understood, it's probably better to hold off a little longer. I'll add labels. |
bnoordhuis commented Nov 16, 2017
Hm, hadn't noticed this has already been merged into v8.x. If no bugs have been reported, then I guess there is no reason to keep it out of v6.x. |
vmarchaud commented Nov 17, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
In the case of PM2, we added the |
Refs: nodejs/node#15380 PR-URL: nodejs/node#16247 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
Refs: nodejs/node#15380 PR-URL: nodejs/node#16247 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
In spawn_sync.cc, two consecutive loops are used to convert data to strings, and compute the size of the data. This commit merges the two independent loops into one. Refs: nodejs/node#15380 PR-URL: nodejs/node#16247 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit exposes the
UV_PROCESS_WINDOWS_HIDEflag in Node as awindowsHideoption to thechild_processmethods. The option is only applicable to Windows, and is ignored elsewhere.This still needs docs, which I'll write if:
windowsVerbatimArguments, for example, is not.Fixes: #15217
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
child_process