Skip to content

tasks.json documentation innacurate? #247

@David-Woodward

Description

@David-Woodward

https://code.visualstudio.com/docs/editor/tasks [vscode-docs/docs/editor/tasks.md] states:

You can also reference environment variables through ${env.Name} (e.g. ${env.PATH}).

But, I this doesn't seem to work for me.

The following tasks.json creates output that actually says "${env.PATH}" rather than substituting the PATH environmental variable.

{
    "version": "0.1.0",
    "command": "cmd",
    "isShellCommand": true,
    "tasks": [
        {
            "taskName": "Run shell command",
            "args": [ "/C", "ECHO", "${env.PATH}" ]
        }
    ]
}

I also tried using "${env.COMSPEC}" in place of "cmd" for the task command and VSCode throws an error saying:

'${env.COMSPEC}' is not recognized as an internal or external command, operable program or batch file.

(First timer here - sorry if this is posted in the wrong place/format)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions