7

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.

1
  • I am having the same issue. Please let me know if you found the answer. Commented Apr 18, 2018 at 20:26

2 Answers 2

4

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.

Sign up to request clarification or add additional context in comments.

1 Comment

To make these settings global, create a launch argument in settings.json and paste the configuration. stackoverflow.com/questions/55173013
0

Set "console":"none" like such:

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

1 Comment

This seems to no longer work using the "debugpy" type, as is recommended for python now

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.