-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Environment variables are not expanded #170104
Comments
@Tyriar the |
@Tyriar Here's what I did in a stock Windows Sandbox:
[Environment]::SetEnvironmentVariable('TEST_VAR1', 'foo', 'User')
[Environment]::SetEnvironmentVariable('TEST_VAR2', '%TEST_VAR1%', 'User')
{
"terminal.explorerKind": "external",
"terminal.external.windowsExec": "wt"
}
echo $Env:TEST_VAR2 which gives: |
Just found out the exact same thing happens in VS Code's terminal. To reproduce I downloaded the current insiders version (1.78.0-insider f31dffc), opened an internal terminal, typed @Tyriar have you already tried with the reproduction steps in my previous comment? And is there anything else I can do to move this issue forward? |
When using an external terminal, this is due to an issue in Windows Terminal. |
Looks like the upstream problem is fixed. It will come through to us eventually, it's shipped with Windows though so it's quite a slow process. |
Type: Bug
With 2 environment variables as follows:
and these VS Code settings:
then when I do
Open in Windows Terminal
and typeecho $Env:JAVA_HOME
(with PowerShell 7.3.1 being my default profile in Windows Terminal), the output is%JAVA_HOME_DEFAULT%
.However, when I open Windows Terminal outside of VS Code and type the same, the output is correct:
C:\path\to\directory
.VS Code version: Code - Insiders 1.75.0-insider (6ed4d43, 2022-12-23T05:21:57.802Z)
OS version: Windows_NT x64 10.0.22621
Modes:
Sandboxed: Yes
Extensions: none
A/B Experiments
The text was updated successfully, but these errors were encountered: