-
-
Notifications
You must be signed in to change notification settings - Fork 585
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
Passing empty environment variables to child processes convert to 'undefined' using ConEmu + Node #1209
Comments
THIS is NOT fair comparison. ConEmu doesn't ruin node. From your screenshots I can make a conclusion you run bash. Report this to your bash bundle authors. |
Also you said: it runs from cmd. |
The same issue when running cmd.exe in ConEmu. But not using command prompt: The only way for me to reproduce this issue is to run it in ConEmu with any shell (cmd or git bash). I read trough the Third-party application problems page before submitting this issue, but seeing i can only reproduce it in ConEmu, i decided to report it here. |
ConEmu does not change environment variables while running applications. |
I think so yeah. I just tried it with node 7.9, works fine. Switching to node 8.0.0 seems to break it. I will open an issue at node. |
I'll close this issue for now, hope we can find out whats happening at Node side. Thanks for your help @Maximus5 |
@Maximus5 it appears to be caused by an injected dll at ConEmu side: "ConEmuHq.dll" People are able to reproduce it in multiple node versions. Any ideas? |
@Maximus5 IMHO the edge case here is that in process.env.foobar=''; attached is a minimally reproducing script and a Procmon PML trace |
@refack so this is an issue on node side only? Or on ConEmu side as well? |
AFAICT on both sides |
Seems like Node checks for non-zero GetLastError() instead of ERROR_ENVVAR_NOT_FOUND after GetEnvironmentVariable call.
ConEmu doesn't change environment. And hooked GetEnvironmentVariable properly returns empty string. |
What does the ConEmuHq.dll do? Because it does change the behavior of node (regardless of the node bug) |
It's all in docs: http://conemu.github.io/en/ConEmuHk.html TL;DR - it's a required component to bypass conhost bugs and limitations. |
Versions
ConEmu build: 170402 x64
OS version: Windows 10 version 1703 x64
Used shell version git-bash: v2.11.0
Problem description
When executing a process which spawns a child process, which in turn creates another child process, the empty environment variables are passed through as
'undefined'
.Steps to reproduce
git clone [email protected]:nicojs/reproduce-conemu-child-process-environment-bug.git
npm install
.npm test
Actual results
When ran from within ConEmu: the test failes
The test also prints the environment variables to screen. You can see a lot of "undefined" values (the string literal, not an absent value).
For example:
"npm_config_onload_script": "undefined",
Expected results
If ran from cmd or git-bash using mintty directly: the test passes
√ should contain "npm_config_onload_script"
If you now look at the environment variables on screen, you don't see the "undefined" values. Just empty strings.
For example:
"npm_config_onload_script": "",
Additional files
Settings,


The text was updated successfully, but these errors were encountered: