I've been using VS Code for quite some time and just today I started having this strange issue. Previously if I started debugging an program (F5) it would start debugging and show output in the "Debug Console":
But now It starts debugger in the "Terminal" and also outputs to "Debug Console".
Here is my launch.json:
{ "version": "0.2.0", "configurations": [{ "name": "Python: Current File", "type": "python", "request": "launch", "program": "${file}" } ] }
I want output only in the "Debug Console" (previously default behavior). Please help me with setting it back to the way it was.
To run or debug a simple app in VS Code, select Run and Debug on the Debug start view or press F5 and VS Code will try to run your currently active file. However, for most debugging scenarios, creating a launch configuration file is beneficial because it allows you to configure and save debugging setup details.
To set Visual Studio debugger options, select Tools > Options, and under Debugging select or deselect the boxes next to the General options. You can restore all default settings with Tools > Import and Export Settings > Reset all settings.
In the Visual Studio toolbar, make sure the configuration is set to Debug. To start debugging, select the profile name in the toolbar, such as <project profile name>, IIS Express, or <IIS profile name> in the toolbar, select Start Debugging from the Debug menu, or press F5.
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"
As suggested in omartin2010's answer you can additionally set the option
"internalConsoleOptions": "openOnSessionStart"
to automatically open the debug console when starting debugging.
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"
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" ]
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