microsoft / microsoft/vscode-cpptools

Output can only shown on debug console on Visual Studio Code on macOS.

Open
#11,771 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug debugger
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and Version: macOS 14.1.2
  • VS Code Version: 1.85.0
  • C/C++ Extension Version: 1.18.5
  • clang++ Version: 15.0.0
Bug Summary and Steps to Reproduce

Bug Summary:
I can only get output from the debug console.

Steps to reproduce:

  1. Create an empty folder called helloworld and open it with Visual Studio Code.
  2. Create a cpp file called main.cpp.
  3. Add some basic code to the main.cpp file like below

#include

int main() {
std::cout << "Hello World!" << std::endl;
return 0;
}

  1. Press run button to the top right with clang++ 15.0.0.
  2. I can get from debug console.
image

Expected behavior:

I expect the output shown in the terminal like in windows11.

Configuration and Logs
task.json:
{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: clang++ build active file",
            "command": "/usr/bin/clang++",
            "args": [
                "-fcolor-diagnostics",
                "-fansi-escape-codes",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "Task generated by Debugger."
        }
    ],
    "version": "2.0.0"
}
Other Extensions

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior on macOS using the provided main.cpp and task.json, then compare the output shown by the Run action in the debug console with the expected terminal output. Trace the VS Code C/C++ extension's run and debug entry points to identify where the output destination is selected; done means the sample program's output appears in the terminal.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, vscode
Domain
desktop-dev, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.