How to make VS Code not open a terminal when debugging?

Viewed 1515

I've installed VS Code on Ubuntu 17.04.

When I debug my C++ application, the output is displayed in a dedicated terminal and not within VS Code itself (like Eclipse does).

How do I make VS Code display output within the editor itself, i.e., not open another terminal?

My launch configuration is as follows:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "gdb",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceRoot}/a.out",
            "args": ["foo", "bar", "baz"],
            "stopAtEntry": false,
            "cwd": "${workspaceRoot}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "g++"
        }
    ]
}

I'd hoped that setting externalConsole to false would solve the problem. However, it didn't change anything.

2 Answers

For a C++ project, use "externalConsole": false, as follows:

enter image description here

This will open integrated terminal instead of external terminal. You can use "internalConsoleOptions": "openOnSessionStart" if you want to open the debug console instead of the integrated/external console:

enter image description here

For a Java project, use , "console": "integratedTerminal" in the configurations file:

enter image description here

Use "console": "internalConsole" if you do not want to see any debug console.

Set "console":"none" like such:

"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}"
"cwd": "${workspaceFolder}"
"console": "none"
Related