VS Code starts debugging in integrated terminal instead of debug console
Originally the config below worked, but it seems to have been deprecated and it now throws an error:
"console": "none"
The new usage is:
"console": "internalConsole"
There's a bug logged in GitHub to update the docs here.
Edit 3
As with the release 2019.4.0 of the python extension it is now possible to set the console
option to internalConsole
(#4321).
In .vscode/launch.json
:
"console": "internalConsole"
Edit 2
As suggested in omartin2010's answer you can additionally set the option
"internalConsoleOptions": "openOnSessionStart"
to automatically open the debug console when starting debugging.
Edit 1
Setting the "console" option explicitly to "none"
was originally the way to go (see answers), but now "none" is no longer valid (see Edit 3 above)
"console": "none"
Original answer
To ensure that the output is written to the debug console you can set the debugOptions.
Adding the following entry to your configuration in yourlaunch.json
should fix it:
"debugOptions": [
"RedirectOutput"
]
It's also possible, as of I guess not too long ago, to add this option... not sure it was possible before:
{
...
"internalConsoleOptions": "openOnSessionStart",
...
}
hope this helps
I had the same problem but I solved it by adding a new configuration at the top that looked like this:
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "internalConsole"
},
I found this a better solution because I didn't have to change one of my other debug functions. In your case the "Python: Terminal (integrated)" debug option. Which I need as much as I need the debug console function. I use both function and they show the output where I want the output to be shown.