Skip to content

No-config debugging triggers all of my open vs code windows to attempt to connect #645

@zbs

Description

@zbs

Currently I debug python on a remote server by running

python -m debugpy --wait-for-client --listen 5678 /path/to/script.py

and then in my launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Remote Attach",
            "type": "python",
            "request": "attach",
            "connect": {
                "host": "localhost",
                "port": 5678
            },
            "pathMappings": [
                {
                    "localRoot": "${workspaceFolder}",
                    "remoteRoot": "."
                }
            ],
            "justMyCode": false
        },
        {
            "name": "Python: launch",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        }
    ]
}

I have several other VS code windows open pointing to different workspace roots on the same host, each with different ports that they bind to for debugging. Due to no-config debugging, when I run the above command, the various windows will all attempt to start debugging, instead of just the one I launched debugpy in. They usually fail with

Server[pid=XXXX] is already being debugged

Worth noting that I'm running debugpy within tmux.

Is there a setting to disable this new behavior, or to somehow specify which window it debugs in (analogous to both the command and launch.json specifying an agreed-upon port number).

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage-neededNeeds assignment to the proper sub-team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions