10000 Evironment variables not expanding in tasks · Issue #72029 · microsoft/vscode · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Evironment variables not expanding in tasks #72029
Closed
@robertcampion

Description

@robertcampion

Environment variables (of the form ${env:name}) are not expanding, or are expanding to the empty string, when occurring in tasks.json. This was working as of about a week ago, but didn't work today.

  • Version: 1.33.0 (user setup)
  • Commit: 0dd516d
  • Date: 2019-04-04T15:14:28.026Z
  • OS: Windows_NT x64 10.0.17763

Also tested in the Insiders build:

  • Version: 1.34.0-insider (user setup)
  • Commit: 56f1b47
  • Date: 2019-04-09T05:19:45.294Z

Steps to Reproduce:

  1. Create a new empty folder; add .\.vscode\tasks.json with the following contents:
    {
        "version": "2.0.0",
        "tasks": [
            {
                "label": "echo path",
                "type": "shell",
                "command": "Write-Host ${env:PATH}",
            }
        ]
    }
    
  2. Run this task (Ctrl+Shift+P, Tasks: Run Task, echo path); the output is:
    > Executing task: Write-Host  <
    
    Terminal will be reused by tasks, press any key to close it.
    
    i.e. the environment variable expands to the empty string.
  3. Run the same command in the terminal (Ctrl+Shift+`, run Write-Host ${env:PATH}); the system path is printed.

Does this issue occur when all extensions are disabled?: Yes

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugcandidateIssue identified as probable candidate for fixing in the next releasetasksTask system issuesverifiedVerification succeeded

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0