wt.exe ignores environment of parent (calling) process #15023

Open
opened 2026-01-31 04:26:22 +00:00 by claunia · 0 comments
Owner

Originally created by @rashil2000 on GitHub (Aug 31, 2021).

Windows Terminal version (or Windows build number)

10.0.19043.1165 1.10.1933.0

Other Software

No response

Steps to reproduce

  1. Open up cmd.exe (in conhost)
  2. Do set SOME_VAR=some_value
  3. Type conhost. In the newly launched window, check for SOME_VAR variable. It'll be set. Close this new window.
  4. In the original cmd.exe shell, type wt. In the newly launched window, check for SOME_VAR variable. It'll be absent.

Expected Behavior

I expect any new processes launched from the original shell to inherit the parent's environment.

Actual Behavior

The wt.exe executable is probably the first ever process I have seen (in my limited experience) that ignores the parent's environment. All other processes (including conhost) inherit the environment.

Note that I searched for similar issues, and found numerous ones pertaining to refreshing the environment variables automatically for new tabs/panes. This is not that.

There is actually an issue - #4259 - which slightly mentions this sort of thing, but again the issue title there is regarding panes and not the process in general.

Originally created by @rashil2000 on GitHub (Aug 31, 2021). ### Windows Terminal version (or Windows build number) 10.0.19043.1165 1.10.1933.0 ### Other Software _No response_ ### Steps to reproduce 1. Open up cmd.exe (in conhost) 2. Do `set SOME_VAR=some_value` 3. Type `conhost`. In the newly launched window, check for **SOME_VAR** variable. It'll be set. Close this new window. 4. In the original cmd.exe shell, type `wt`. In the newly launched window, check for **SOME_VAR** variable. It'll be absent. ### Expected Behavior I expect any new processes launched from the original shell to inherit the parent's environment. ### Actual Behavior The `wt.exe` executable is probably the first ever process I have seen (in my limited experience) that ignores the parent's environment. All other processes (including conhost) inherit the environment. Note that I searched for similar issues, and found numerous ones pertaining to refreshing the environment variables automatically for new tabs/panes. This is not that. There is actually an issue - #4259 - which slightly mentions this sort of thing, but again the issue title there is regarding panes and not the process in general.
claunia added the Needs-TriageNeeds-Tag-Fix labels 2026-01-31 04:26:22 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#15023