New tabs inherit the environment of the Terminal process instead of the user default environment. #6392

Closed
opened 2026-01-31 00:37:27 +00:00 by claunia · 4 comments
Owner

Originally created by @yitzhaks on GitHub (Feb 12, 2020).

Environment

Windows build number: 10.0.19559.0
Windows Terminal version (if applicable): 0.8.10261.0

Steps to reproduce

  1. In a terminal tab, run any command that modified the user/system environment (e.g. SETX).

Expected behavior

When opening a new tab, the environment should reflect the change made in step 1.

Actual behavior

The environment doesn't reflect the change made in step 1.
I assume this is because CreateProcessW is called with lpEnvironment == nullptr which means the new process uses the environment of the calling process.

This is frustrating since if one makes a change to the user/system environment, one needs to close all Terminal tabs (or start a new Terminal) to get a tab that reflects said change.

Originally created by @yitzhaks on GitHub (Feb 12, 2020). # Environment ```none Windows build number: 10.0.19559.0 Windows Terminal version (if applicable): 0.8.10261.0 ``` # Steps to reproduce 1. In a terminal tab, run any command that modified the user/system environment (e.g. SETX). # Expected behavior When opening a new tab, the environment should reflect the change made in step 1. # Actual behavior The environment doesn't reflect the change made in step 1. I assume this is because `CreateProcessW` is called with `lpEnvironment == nullptr` which means `the new process uses the environment of the calling process`. This is frustrating since if one makes a change to the user/system environment, one needs to close all Terminal tabs (or start a new Terminal) to get a tab that reflects said change.
claunia added the Resolution-Duplicate label 2026-01-31 00:37:27 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Feb 13, 2020):

This is a /dupe of #1125 (but really, it's badly-named: it means "terminal should do the environment thing properly". Sorry about that!)

@DHowett-MSFT commented on GitHub (Feb 13, 2020): This is a /dupe of #1125 (but really, it's badly-named: it means "terminal should do the environment thing properly". Sorry about that!)
Author
Owner

@ghost commented on GitHub (Feb 13, 2020):

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!

@ghost commented on GitHub (Feb 13, 2020): 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!
Author
Owner

@DHowett-MSFT commented on GitHub (Feb 13, 2020):

Thanks for the CreateProcess info. 😄

@DHowett-MSFT commented on GitHub (Feb 13, 2020): Thanks for the CreateProcess info. :smile:
Author
Owner

@yitzhaks commented on GitHub (Feb 13, 2020):

Thanks for pointing me to the dupe. I searched before opening this issue, but didn't use the right terms to find #1125.

@yitzhaks commented on GitHub (Feb 13, 2020): Thanks for pointing me to the dupe. I searched before opening this issue, but didn't use the right terms to find #1125.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6392