Environment variable references in environment variables are not resolved with wt.exe #19719

Open
opened 2026-01-31 06:51:46 +00:00 by claunia · 0 comments
Owner

Originally created by @anthonyvdotbe on GitHub (Apr 16, 2023).

Windows Terminal version

1.16.10262.0

Windows build number

10.0.22621.0

Other Software

No response

Steps to reproduce

  • open PowerShell and run the following 2 commands:
[Environment]::SetEnvironmentVariable('TEST_VAR1', 'foo', 'User')
[Environment]::SetEnvironmentVariable('TEST_VAR2', '%TEST_VAR1%', 'User')
  • open Windows Terminal via the start menu and run:
echo $Env:TEST_VAR2
  • open Windows Terminal via wt.exe (or Open in Terminal in File Explorer, but I assume that's the same thing) and run:
echo $Env:TEST_VAR2

Expected Behavior

The result is the same: foo.

Actual Behavior

The result is different: the first time it prints foo, the second %TEST_VAR1%.

Note there are similar open (#12545) and resolved (#12602, #11777) issues.

Originally created by @anthonyvdotbe on GitHub (Apr 16, 2023). ### Windows Terminal version 1.16.10262.0 ### Windows build number 10.0.22621.0 ### Other Software _No response_ ### Steps to reproduce * open PowerShell and run the following 2 commands: ```powershell [Environment]::SetEnvironmentVariable('TEST_VAR1', 'foo', 'User') [Environment]::SetEnvironmentVariable('TEST_VAR2', '%TEST_VAR1%', 'User') ``` * open Windows Terminal via the start menu and run: ```powershell echo $Env:TEST_VAR2 ``` * open Windows Terminal via `wt.exe` (or `Open in Terminal` in File Explorer, but I assume that's the same thing) and run: ```powershell echo $Env:TEST_VAR2 ``` ### Expected Behavior The result is the same: `foo`. ### Actual Behavior The result is different: the first time it prints `foo`, the second `%TEST_VAR1%`. Note there are similar open (#12545) and resolved (#12602, #11777) issues.
claunia added the Issue-BugResolution-Duplicate labels 2026-01-31 06:51:46 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19719