Python Vs Code Debug - Capture Sigterm?
I'd like to force sys.exit() when the python debugger is stopped. When I stop the debugger I see Terminated: 15 so I assume this is SIGTERM. However, when stopping the debugger, my
Solution 1:
For now we seem to be OOL (out of luck) - I ran into the same issue and found that VS Code python extension does issue a SIGKILL on debug stop, which cannot be cought.
Unlike the node.js extenstion, the Python extension also does not support setting the type to SIGTERM or SIGINT.
The only workaround I found is to have an open terminal (type: Pythen Debug Terminal) in VS Code. It should show the python command behavior and output during debug. Bring the terminal into focus by clicking on it and press ctrl-C manually. This should stop the debugged program gracefully and your catching the SIGTERM or SIGINT will work.
Post a Comment for "Python Vs Code Debug - Capture Sigterm?"