-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Reload environment variables by default; add setting to disable #14999
Reload environment variables by default; add setting to disable #14999
Conversation
This comment has been minimized.
This comment has been minimized.
ReloadEnvironmentVariables.mp4 |
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.
wow you're right that was easy.
My tiny nit is that we've been discussing internally on re-aligning some of the experimental
settings we have as compatibility
flags instead. That's not something you'd have possibly known, and I'm pretty sure my initial writeup called for experimental.
too.
Honestly this is gonna be such goodness that I want to just hit ✅ anyways
Umm why am I getting static analysis failures on code I haven't touched? Edit: I see #15002 has been opened to address this. |
Now the build's failing due to #14581. |
{ | ||
envMap.Insert(key, value); | ||
} | ||
} | ||
envMap.Insert(L"WT_PROFILE_ID", guidWString); |
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.
I love the simplicity of this, but I am a little bit concerned about what happens after we hand this environment block off.
We produce a new env block here, painstakingly inserting it into envMap... and then ConptyConnection uses EnvironmentVariableMapW
to generate a new map based on the current process environment and inserts the contents of envMap
from here into it.
In brief... what we will get is a hybrid of Terminal's spawning environment and the current environment. As well, we will probably end up parsing the entire env twice.
Should we move this down to ConptyConnection (worm the boolean down in through the valueset for all I mind, ha) and make sure we do not call UpdateEnvironmentMapW
?
Huh, moving that down to connection made audit run on Probably like this, with a push/pop // Some of the interactivity classes pulled in by ServiceLocator.hpp are not
// yet audit-safe, so for now we'll need to disable a bunch of warnings.
#pragma warning(disable : 26432)
#pragma warning(disable : 26440)
#pragma warning(disable : 26455)
// We end up including ApiMessage.h somehow, which uses nameless unions
#pragma warning(disable : 4201)
Or you could fix the warnings now :P
|
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.
beautiful. thanks for the quick patch!
Hey @lhecker, would you be willing to fix the audit failures on-branch so we can quick merge Ian's work? |
This comment has been minimized.
This comment has been minimized.
I've fixed the audit mode issues, as well as some others. I've also made some further improvements to However now that I understand how |
In the name of incremental progress - merge now, and fast-follow with a PR for "cache a static 'base' env block and only reload it on WM_SETTINGCHANGE"? |
I had actually fixed some of the audit issues this morning - rather than just ignoring them :) |
Ah, sorry to override/duplicate your effort @ianjoneill! |
I've tried to look for |
What are you trying to accomplish exactly? The setting added as |
Summary of the Pull Request
Adds a global setting
compatibility.reloadEnvironmentVariables
with a default value oftrue
. When set, during connection creation a new environment block will be generated to ensure it has the latest environment variables.Validation Steps Performed
Manually tested - see video in the
firstsecond comment.PR Checklist