Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code starts debugging in integrated terminal instead of debug console

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":

enter image description here

But now It starts debugger in the "Terminal" enter image description here 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.

like image 844
HaMAD Avatar asked Mar 30 '18 10:03

HaMAD


People also ask

How do I start Debug console in VS Code?

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.

How do I change the debugger in Visual Studio?

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.

How do I enable debugging in Visual Studio?

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.


1 Answers

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" ] 
like image 75
HaaLeo Avatar answered Sep 17 '22 18:09

HaaLeo