Skip to content

use an environment variable to select port in launch.json #18841

Closed
@giaco5988

Description

@giaco5988

Similar to microsoft/vscode-java-debug#962 I would to like use an environment variable DEBUG_PORT to set the port on which the python debugger is listening.

Now it does not seem possible because the port variable in launch.json needs to be a number. If I try setting an env variable, as in the code below, I get the following error:
}
"name": "Py listen",
"type": "python",
"request": "attach",
"listen": {
"host": "localhost",
"port": "${env:DEBUG_PORT}"
}
Screenshot 2022-04-01 at 10 27 32

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions