Every time I build or run a program in VSCode a new python debug console is loaded. Before I know it I have 20+ and need to start deleting them. After 32 open consoles I get the error "The terminal process terminated with exit code: 256". I changed the terminal from the default console to git bash recently. How can I stop this?
VS Code maintains a debug session while the program is running, and pressing the Stop button terminates the program.
A launch. json file is used to configure the debugger in Visual Studio Code. Visual Studio Code generates a launch. json (under a . vscode folder in your project) with almost all of the required information.
Switch to the Run and Debug view (Ctrl+Shift+D) and select the create a launch. json file link. VS Code will let you select an "debugger" in order to create a default launch configuration. Pick "Mock Debug".
Breakpoints are one of the most important debugging techniques in your developer's toolbox. You set breakpoints wherever you want to pause debugger execution. For example, you may want to see the state of code variables or look at the call stack at a certain breakpoint.
A way around this issue is to stop VS Code from redundantly printing to the TERMINAL
during debugging in the first place. Since it prints to the DEBUG CONSOLE
as well, you can use that instead.
Change console
to "none"
"internalConsole"
in each configuration in your project's launch.json
file:
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "internalConsole"
}
]
May 2019 Update: the "none"
option was replaced by "internalConsole"
so I edited my answer to reflect that. Here's the relevant GitHub Issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With