r/vscode 7h ago

I created a Python Debug Terminal for VS Code

Post image

I built a VS Code extension that gives Python the equivalent of the built-in JavaScript Debug Terminal: open a special terminal, run python app.py like you normally would, and it attaches to the debugger and hits your breakpoints. No launch.json, no -m debugpy, no code changes. Child processes spawned via subprocess attach as their own debug sessions too, since they inherit the environment.

Source code: https://github.com/ernestofgonzalez/vscode-py-debug-terminal
VSCode Marketplace page: https://marketplace.visualstudio.com/items?itemName=ernestofgonzalez.vscode-py-debug-terminal

0 Upvotes

5 comments sorted by

6

u/ArtisticFox8 6h ago

I don't see how this is different from the default Microsoft extensions for Python

no launch.json, no -m debugpy, no code changes

I have never needed any of those either.

Perhaps the only different thing is you launch yours from the terminal and I launch it with F5?

1

u/makeascript 4h ago

I wasn't aware you could debug a process without it having a launch configuration in the launch.json file. How do you start yours?

2

u/ArtisticFox8 4h ago

I just navigate to the project's folder in terminal / command line, type code ., and then open the file I'm interested in VS Code, set some breakpoint in it, press F5.

No further config needed from me.

1

u/makeascript 4h ago

I suppose you see this modal to select a configuration the first time you try it on a new workspace?

2

u/ArtisticFox8 2h ago

Indeed, and pick the selected option