Skip to content
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 expand to empty strings in tasks.json #72135

Closed
doxxx opened this issue Apr 11, 2019 · 4 comments
Closed

Environment variables expand to empty strings in tasks.json #72135

doxxx opened this issue Apr 11, 2019 · 4 comments
Assignees
Labels
tasks Task system issues

Comments

@doxxx
Copy link

doxxx commented Apr 11, 2019

Issue Type: Bug

  1. Define a task that uses ${env:FOO} syntax to reference an existing environment variable.
  2. Execute that task.
  3. Observe that the expansion for that variable is an empty string.

The integrated terminal shows the expected env variable, so it's just the tasks.json that's affected (maybe other parts of VS Code too).

Does this issue occur when all extensions are disabled?: Yes (I checked this by creating a new Explorer shortcut to VS Code, with the disable option added to the commandline)

Example tasks.json
{
    "label": "loader: clean build",
    "type": "shell",
    "command": "./build.sh",
    "options": {
        "cwd": "${workspaceRoot}/projects/loader"
    },
    "windows": {
        "command": "${env:CYGWIN}/bin/bash.exe",
        "args": [
            "-c",
            "source /etc/profile; source $HOME/.profile; ./build.sh"
        ],
        "options": {
            "env": {
                "CHERE_INVOKING": "1"
            }
        }
    },
    "problemMatcher": [
        "$gcc"
    ]
}

VS Code version: Code 1.33.0 (0dd516d, 2019-04-04T15:14:28.026Z)
OS version: Windows_NT x64 10.0.17134

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz (8 x 2712)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 31.85GB (24.95GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (38)
Extension Author (truncated) Version
scratchpad awe 0.1.0
spellright ban 3.0.38
better-toml bun 0.3.2
npm-intellisense chr 1.3.0
gitignore cod 0.6.0
systemd-unit-file coo 1.0.3
vscode-markdownlint Dav 0.26.0
vscode-eslint dba 1.8.2
gitlens eam 9.6.0
vscode-npm-script eg2 0.3.5
vscode-pull-request-github Git 0.6.0
nsis idl 3.16.1
vscode-react-typescript inf 1.1.0
intellij-idea-keybindings k-- 0.2.31
vscode-azureappservice ms- 0.13.0
vscode-cosmosdb ms- 0.10.1
python ms- 2019.3.6558
azure-account ms- 0.8.1
cpptools ms- 0.22.1
csharp ms- 1.18.0
Go ms- 0.9.2
powershell-preview ms- 2.0.1
vscode-typescript-tslint-plugin ms- 1.0.0
debugger-for-chrome msj 4.11.3
vscode-docker Pet 0.6.1
typescript-hero rbb 3.0.0
java red 0.42.1
windbg-debug rez 0.3.4
rust rus 0.6.1
vscode-zipexplorer sle 0.3.1
rewrap stk 1.9.1
cmake twx 0.0.17
vscodeintellicode Vis 1.1.5
vscode-java-debug vsc 0.17.0
vscode-java-dependency vsc 0.4.0
vscode-icons vsc 8.5.0
debug web 0.23.1
jinja who 0.0.8
@vscodebot vscodebot bot added the tasks Task system issues label Apr 11, 2019
@doxxx doxxx changed the title VS Code launched from Windows Explorer does not inherit all system environment variables Environment variables expand to empty strings in tasks.json Apr 11, 2019
@doxxx
Copy link
Author

doxxx commented Apr 11, 2019

After some further investigation, I realized the problem is a little more fundamental than I initially thought, hence the major edit above.

@doxxx
Copy link
Author

doxxx commented Apr 11, 2019

This was working some weeks ago, so I think it's a regression.

@David-Else
Copy link

Fixed I think #72029

@doxxx
Copy link
Author

doxxx commented Apr 11, 2019

Ah, dang it. I searched but I didn't find that one. Thanks!

@doxxx doxxx closed this as completed Apr 11, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators May 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tasks Task system issues
Projects
None yet
Development

No branches or pull requests

3 participants