Repository navigation
Is there a way to run debugpy from the terminal without manually launching the client? #25842
Replies: 4 comments
|
You can avoid manually using the Run and Debug UI, but you still need a debugger client to connect to the debugpy server. One practical approach is to start the debugpy server from the terminal and then trigger the VS Code debug configuration with a keyboard shortcut or a task/command. For example, keep your attach configuration in
After that, start the existing “Python Debugger: Remote Attach” configuration in VS Code. If you want this to feel like one action, you can combine the terminal command and the attach configuration with a VS Code task or compound workflow. The important part is that |
|
You can avoid manually using the Run and Debug UI, but you still need a debugger client to connect to the debugpy server. One practical approach is to start the debugpy server from the terminal and then trigger the VS Code debug configuration with a keyboard shortcut or a task/command. For example, keep your attach configuration in
After that, start the existing “Python Debugger: Remote Attach” configuration in VS Code. If you want this to feel like one action, you can combine the terminal command and the attach configuration with a VS Code task or compound workflow. The important part is that |
|
You can avoid manually using the Run and Debug UI, but you still need a debugger client to connect to the debugpy server. A practical workflow is:
If you want this to feel like one action, you can combine the terminal command and the attach step using a VS Code task or compound configuration. The important part is that |
|
You can avoid manually using the Run and Debug UI, but you still need a debugger client to connect to the debugpy server. A practical workflow is:
If you want this to feel like one action, you can combine the terminal command and the attach step using a VS Code task or compound configuration. The important part is that |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
To use debugpy in the terminal, you have to do three steps:
Prerequisite
{ "version": "0.2.0", "configurations": [ { "name": "Python Debugger: Remote Attach", "type": "debugpy", "request": "attach", "connect": { "host": "localhost", "port": 5678 }, "pathMappings": [ { "localRoot": "${workspaceFolder}", "remoteRoot": "." } ] } ] }Launch your job with debugpy server in the terminal.
Launch the debugger from 'Run and Debug' menu for the debugpy client
Is there a way to skip step 3? This is a much more streamlined approach when wanting to run pytest in the terminal (I don't like using the Testing UI)
All reactions