-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
wt ignore env-vars set in the script launching it, due to new "auto reload system env vars with new window / tab" #15430
Comments
I might not think it's really a issue, but this change might break some script. Should the new "auto-reload system environment variable" feature set to be "opt-in", rather than "default-on"? related change #14999 |
I can't reproduce this behaviour: ReloadEnvironmentVariables.mp4I don't think #14999 is at fault here - I think it's likely #5000. As of #5000 there is one overarching As of version 1.18, when In version 1.17, the new (Apologies for the screenshots being from different PCs running different Windows versions - it was easier for logistical reasons.) |
thanks for reply! I can confirm that no matter how maybe I wasn't clear, on the 1st step of my first post, I do means open a mybe we find 2 different situations that have similar behavior? |
this could be a nasty task, that |
Ah, opening a If in the same |
so, would you consider make i used to write a powershell script, doing some env modification(mostly add msys2 into PATH), then launching wt, with 4 split panes, each runs a msys2 binary. If I can disable auto-reload with a env var / wt commandline argument, then I can just add another line in my script before launching wt, that my old script would just run fine. and I also will be benefit from new auto-reload mechanism with a interactive use case. |
Update:
for anyone encounter the same problem:
I suggest to set envrionment variables in Windows Terminal, and do not set env vars in script and let wt inherit it.
If you use powershell script, here is my solution:
Windows Terminal version
1.18.1421.0
Windows build number
10.0.19045.0
Other Software
PowerShell 7.4
Steps to reproduce
openopen a standalonepowershell
powershell
commandline window (not inwt
window)$Env:MY_VAR="MY_VAL"
wt
echo $Env:MY_VAR
after I disable
compatibility.reloadEnvironmentVariables
in globalsettings.json
, new wt window inherit env var set in powershellExpected Behavior
No response
Actual Behavior
see above
The text was updated successfully, but these errors were encountered: