Cannot launch multiple Python debug sessions using VSC API
See original GitHub issueEnvironment data
- VS Code version: 1.37.1
- Extension version (available under the Extensions sidebar): 2019.9.34474
- OS and version: Win10
- Python version (& distribution if applicable, e.g. Anaconda): 2.7
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
- Relevant/affected Python packages and their versions: N/A
- Jedi or Language Server? (i.e. what is
"python.jediEnabled"
set to; more info #3977): N/A
Expected behaviour
multiple Python debug sessions get launched upon executing the following code inside an extension:
for (let request of launchRequests) {
request.executable = request.executable.toLowerCase();
if (request.executable.endsWith("python") || request.executable.endsWith("python.exe")) {
const pythonScript: string = request.arguments.shift();
const pythonlaunchdebugconfiguration: vscode.DebugConfiguration = {
name: `Python: launch`,
type: "python",
request: "launch",
program: pythonScript,
args: request.arguments,
env: request.env,
stopOnEntry: true,
};
vscode.debug.startDebugging(undefined, pythonlaunchdebugconfiguration);
}
}
Actual behaviour
only 1 debug session gets launched, other debug sessions would hit a timeout error like this:
Note
related to https://github.com/microsoft/vscode-python/issues/6017
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Debugging configurations for Python apps in Visual Studio Code
If you're only interested in debugging a Python script, the simplest way is to select the down-arrow next to the run button on...
Read more >visual studio code - run multiple python scripts at the same time
If there is no debug configuration yet, open the menu next to the run button and click on "add configuration ([your source folder])"....
Read more >How to debug Python scripts in Visual Studio Code - SQLShack
Select Start Debugging from the Run menu · Selecting the Run icon from the left pane and click on Run and Debug ·...
Read more >Debug Python code - Visual Studio (Windows) - Microsoft Learn
With a stand-alone Python file open, right-click in the editor, select Start with Debugging, and Visual Studio launches the script with the ...
Read more >Debugging - vscode-docs
To debug your app in VS Code, you'll first need to set up your launch configuration file - launch.json . Click on the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’d block this issue, waiting for the new Debug Adapter work. Else we’ll end up doubling our work looking at issues in both debug adapters.
We need to test this. It should not be a problem anymore, since we use the same mechanism as above to attach to multiple processes. The only thing that is concerning is that this is using
integratedTerminal
which is default. I am not sure how that impact will be when launching multiple processes.