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

Open
opened 2026-01-31 00:37:25 +00:00 by claunia · 0 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:25 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6389