Path variable from the environment is not respected
Windows Terminal version
1.22.240926002-preview
Windows build number
10.0.22621.819
Other Software
No response
Steps to reproduce
run: cmd.exe type: set path=c:\tweet;%path% type your path to terminal: "C:\Users\Admino\AppData\Local\Temp\WindowsTerminal\x64\WindowsTerminal.exe" open a cmd window in terminal and type: path
WindowsTerminal.exe shows the right path "c:\tweet;...." OpenConsole.exe also shows the right path "c:\tweet;...." but then cmd.exe has a different path
Expected Behavior
to see the active environment to see "c:\tweet"
Actual Behavior
shows the wrong path probably the environment is retrieved from the registry instead of the environment
Checked with ProcessHacker to see the environment of individual executables
WindowsTerminal.exe shows the right path "c:\tweet;...." OpenConsole.exe also shows the right path "c:\tweet;...." cmd.exe has a different path
Windows Terminal treats each tab and pane like a "container" of sorts. Each one gets its own fresh environment variables. You can disable that behavior here:
i see, indeed that works for new tabs but not for the one that is there when launched.
i also use these settings default profile: Command Prompt when terminal starts: open tab with default profile
Also it does not show the correct path wen a tab is created with a new instance.
i have this setting new instance behavior: attach to the most recently used window
Thanks for filing! Assuming Windows Terminal is set as your default terminal, start cmd should create a new window and immediately hand off to windows terminal, which would then have the expected environment block. This can be used as a workaround for your scenario. If you do wt new-tab -w0 cmd, that should work too. Does that work for you ?
Note #16226 may be involved here.
Thanks for filing! Assuming Windows Terminal is set as your default terminal
Don't even know how to do that, it most likely can't be automated as MS implemented encryption for default file associations, so no it is not the default
Does that work for you ?
it does, but not my preferred solution
Note #16226 may be involved here.
Good find buddy
Indeed, seems to be a reoccurring issue, you can not expect all users to start hunting for command line parameters, when the default behaviour is that a app inherits the environment from the caller.
I used --inheritEnvironment from there as the cleaner outcome
To bad MS does not respect the environment and reads the registry instead, now many other devellopers also do that, a example WindowsTerminal writes to %LocalAppdata% but uses the one from the registry, i am not gonna mess with that, i attempted it years ago, but that is a global change and all other crappie apps will start to write at the new location too, so sad :( Maybe that should be a different issue.
i am not gonna mess with that, i attempted it years ago, but that is a global change and all other crappie apps will start to write at the new location too, so sad :( Maybe that should be a different issue.
You must know that redirecting the known folders like AppData/LocalAppData is not supported. Please don't file bugs on us, or anyone else, for that.
Thanks for filing! Assuming Windows Terminal is set as your default terminal
Don't even know how to do that, it most likely can't be automated as MS implemented encryption for default file associations, so no it is not the default
Windows Terminal is the default console host on your version of Windows unless you've turned it off explicitly, and it does not work by using "file associations".
Windows Terminal is the default console host on your version of Windows unless you've turned it off explicitly, and it does not work by using "file associations".
Doubt that, i am on win 11 and never have i seen "windows terminal" it always shows cmd.exe or consolehost.exe
At its heart, this is a /duplicate of #15496.
You can use the --inheritEnvironment argument or the profile setting compatibility.reloadEnvironmentVariables (set to false).
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!