VS Code opens a new debug console every time I build/run
Adding "args": ["&&", "exit"],
to launch.json
remedies this for Git Bash. Certainly a hack, but I no longer have to manually close many debug terminals.
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.