咨询VSCode调试器自动附加子进程功能的设置位置
Hey there, I’ve run into this exact issue before—super frustrating when breakpoints stop working once a new process spins up! Here’s exactly where you can find that setting to fix it:
Step-by-Step to Enable Auto-Attach for Subprocesses
- Open VSCode’s Settings panel: Use the shortcut
Ctrl+,(Windows/Linux) orCmd+,(Mac), or click the gear icon in the bottom-left corner and select Settings. - In the search bar at the top, type "Attach to subprocess automatically while debugging"—this will filter directly to the option you need.
- Check the box next to the option to enable it. Alternatively, you can edit your
settings.jsonfile directly by adding this line:"python.debugger.attachSubprocess": true
Once you’ve done that, restart your debug session. The PyDev debugger should now automatically attach to any new subprocesses, and your breakpoints will work as expected.
Just to confirm, this is the exact warning you’re seeing (formatted for clarity):
pydev debugger: starting
pydev debugger: New process is launching (breakpoints won't work in the new process).
pydev debugger: To debug that process please enable 'Attach to subprocess automatically while debugging?' option in the debugger settings.
Bottle v0.12.13 server starting up (using WSGIRefServer())...
Listening on http://0.0.0.0:8080/
Hit Ctrl-...
内容的提问来源于stack exchange,提问作者Black Frog

