VS Code starts debugging in integrated terminal instead of debug console

visual studio code debug c++
visual studio code debug c#
launch json vscode c
vscode prelaunchtask
please first open a folder in order to do advanced debug configuration.
launch.json environment variables
vs code debug c
debug javascript in visual studio code

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.

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).

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 the way to go. See comments.

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

Debugging in Visual Studio Code, VSCode Version: Code 1.7.2 (7ba55c5, 2016-11-21T22:01:10.756Z) OS When I debug my c/c++ program, vscode will open an external Te here https://code.​visualstudio.com/docs/editor/debugging#_node-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”: But now It starts debugger in the “Terminal” and also outputs to “Debug Console”. Here is my launch.json: […]

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": "none"
},

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.

I want to Debug at the Integrated Terminal · Issue #16890 · microsoft , Testing #19039 The command should be launched using bash -c or host and review code, manage projects, and build software together. debuggee in the Integrated Terminal (instead of the debug console), @weinand because under Git Bash or WSL on windows debugging will be broken as above. 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:

The preferred answer above of setting

    "console": "none" 

now throws an error.

The new usage is

    "console": "internalConsole"

There's a bug logged in GitHub to update the docs here.

Debug console using integrated terminal should not run under the , 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). When debugging in Python, in VS Code, it is creating a new terminal every time I debug. Code just keeps adding a terminal every time to the dropdown list in the terminal window. I have to manually delete each terminal, or delete a bunch of them after a while - otherwise it eventually hangs.

{
    "name": "Python: Current File",
    "type": "python",
    "request": "launch",
    "program": "${file}",
    "stopOnEntry": false,
    "console": "none"
},

these are my launch.json settings and it's working with this.

Debugging configurations for Python apps in Visual Studio Code, Note Starting a debugging session through the Debug Panel, F5 or Run > Start run the active file in the editor in either the integrated terminal (inside VS Code) or the external specify its path instead in the pythonPath property of a debug configuration. Using an external console is necessary to capture the password. The Debug: Run (Start Without Debugging) action is triggered with ⌃F5 (Windows, Linux Ctrl+F5) and uses the currently selected launch configuration. Many of the launch configuration attributes are supported in 'Run' mode. VS Code maintains a debug session while the program is running, and pressing the Stop button terminates the program.

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

Debugging, VS Code's built-in debugger helps accelerate your edit, compile and debug loop. To debug a simple app in VS Code, press kb(workbench.action.debug.start) and VS only: connect to the specified port instead of launching the debug adapter kind of console to use, for example, internalConsole , integratedTerminal  Note: To be used as an integrated terminal, the shell executable must be a console application so that stdin/stdout/stderr can be redirected. Tip: The integrated terminal shell is running with the permissions of VS Code. If you need to run a shell command with elevated (administrator) or different permissions,

Terminal (Console) Apps, Option 1: Integrated Terminal. Open the file to be debugged; From the debug configuration select Integrated Terminal/Console; Start debugging; The integrated  To start debugging in Expo follow these steps: Open your project in VS Code with this extension installed. Create a debug configuration (as described in Debugging React Native applications), select Debug in Exponent in the debug drop-down menu, and start debugging

Debugging JavaScript Projects with VS Code & Chrome Debugger , Michael shows how to ditch console.log() and start debugging JavaScript like a pro, Open the project in VS Code and install the dependencies via the integrated terminal: Make sure the two breakpoints are still in place. In VS Code PowerShell extension, the PowerShellEditorService is the engine behind all the features and that integrated terminal that are added to the environment within Code. You can disable the integrated terminal from showing at all by setting "powershell.startAutomatically" to false. However, the downside to this will be you won't have intellisense in your PS1 files and ability to execute or debug code is gone.

When running code, it always puts the results in terminal instead of , Even when I click 'start debugging' it prints the results in the terminal along with the file paths. I had a similar issue where my logs were getting printed on the terminal instead of debug console. VS Code Drawio Integration. VS Code is a general editor with a generic debugger and is not specialized for a particular stack or runtime. For this reason, we can't provide an opinionated default debug configuration that will work for everyone.

Comments
  • It already does that. But it prints to both terminals and also when i start debugging it goes to the terminal instead of the debug console
  • Then maybe setting the console option explicitly helps. Try to set "console": "integratedTerminal":
  • If you end up needing the terminal it will be more problematic. It would be easier to add a new configuration instead with none
  • Now I get the output only in the debug console as desired, however, how do I get the debug console to automatically launch when i start debugging?
  • Basically, the same answer as @SnitchingAuggie except the "stopOnEntry" attribute. Please explain why this is significant.
  • OP's question refers to python debugging not nodejs
  • The project type is actually pretty irrelevant in this case. This is an issue with the IDE setup in general and applicable to any project type printing output to the debug console. I understand it may be confusing if you copy and paste my full configuration so I will update my answer.