Skip to content

Warning in launch.json: Property env is not allowed #12537

@obsgolem

Description

@obsgolem

Environment

  • OS and version: Windows
  • VS Code: Version: 1.92.0 b1c0a14de1414fcdaa400695b4db1c0799bc3124
  • C/C++ extension: 1,21,5
  • OS and version of remote machine (if applicable):
  • GDB / LLDB version:

Bug Summary and Steps to Reproduce

Bug Summary:
Add the following to any C++ project's launch.json:

{
    "type": "cppvsdbg",
    "request": "launch",
    "name": "INSERT NAME HERE",
    "program": "INSERT PROGRAM PATH HERE",
    "args": [
    ],
    "internalConsoleOptions": "openOnSessionStart",
    "cwd": "${workspaceFolder}",
    "sourceFileMap": {},
    "preLaunchTask": "Build Server",
    "env": {
        "PATH": ""
    }
},

Note that env has a warning Property env is not allowed.

I am aware that environment is the officially recommended way to specify environment variables, but env is works too, and is significantly more convenient, as environment has extremely wacky and unintuitive syntax.

Debugger Configurations

{
    "type": "cppvsdbg",
    "request": "launch",
    "name": "INSERT NAME HERE",
    "program": "INSERT PROGRAM PATH HERE",
    "args": [
    ],
    "internalConsoleOptions": "openOnSessionStart",
    "cwd": "${workspaceFolder}",
    "sourceFileMap": {},
    "preLaunchTask": "Build Server",
    "env": {
        "PATH": ""
    }
},


### Debugger Logs

```shell
placeholder

Other Extensions

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    debuggerhelp wantedCan be fixed in the public (open source) repo.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions