Some system-defined environment variables are undefined #10290

Closed
opened 2026-01-31 02:17:28 +00:00 by claunia · 4 comments
Owner

Originally created by @nathpete-msft on GitHub (Aug 25, 2020).

Environment

Windows build number: 10.0.20201.0
Windows Terminal version (if applicable): 1.3.2372.0

Any other software? Nope

Steps to reproduce

In Powershell: $Env:UserName

In cmd: echo %UserName%

It looks like this variable is defined here: HKEY_CURRENT_USER\Volatile Environment

There are a couple of other variables defined there that are also undefined: %USERDOMAIN% and %USERDNSDOMAIN%

This is only happing after updating to the preview version of Terminal 1.3. The variables are still defined in Terminal 1.2, and when running pwsh/Windows Powershell/cmd outside of Terminal.

Expected behavior

The variable should contain the current user name.

Actual behavior

The variable is undefined.

Originally created by @nathpete-msft on GitHub (Aug 25, 2020). # Environment ```none Windows build number: 10.0.20201.0 Windows Terminal version (if applicable): 1.3.2372.0 Any other software? Nope ``` # Steps to reproduce In Powershell: `$Env:UserName` In cmd: `echo %UserName%` It looks like this variable is defined here: `HKEY_CURRENT_USER\Volatile Environment` There are a couple of other variables defined there that are also undefined: `%USERDOMAIN%` and `%USERDNSDOMAIN%` This is only happing after updating to the preview version of Terminal 1.3. The variables are still defined in Terminal 1.2, and when running pwsh/Windows Powershell/cmd outside of Terminal. # Expected behavior The variable should contain the current user name. # Actual behavior The variable is undefined.
Author
Owner

@DHowett commented on GitHub (Aug 25, 2020):

Regressed w/ #7243.

@DHowett commented on GitHub (Aug 25, 2020): Regressed w/ #7243.
Author
Owner

@zadjii-msft commented on GitHub (Aug 25, 2020):

Should this block 1.3?

@zadjii-msft commented on GitHub (Aug 25, 2020): Should this block 1.3?
Author
Owner

@DHowett commented on GitHub (Aug 25, 2020):

Yeah probably.

@DHowett commented on GitHub (Aug 25, 2020): Yeah probably.
Author
Owner

@DHowett commented on GitHub (Aug 25, 2020):

Investigating: profile API does EXPLICITLY add these vars (!) so i bet it's my token code

@DHowett commented on GitHub (Aug 25, 2020): Investigating: profile API _does_ **EXPLICITLY** add these vars (!) so i bet it's my token code
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10290