microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.53k stars 1.56k forks source link

built in terminal does not start when building and MacOs keeps asking for permission to run everytime when building #12521

Closed eanostman closed 3 months ago

eanostman commented 3 months ago

Environment

Bug Summary and Steps to Reproduce

https://github.com/user-attachments/assets/8b77c32a-9cb7-45df-9dfe-73dc597b8d28

The built-in terminal does not run when building on Mac, and debugging does not work either.

Here are the project files: b.zip

Debugger Configurations

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: g++ build active file",
            "command": "/usr/bin/g++",
            "args": [
                "-fdiagnostics-color=always",
                "-g",
                "-Wall",
                "-std=c++17",
                "${fileDirname}/*.cpp",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "compiler: /usr/bin/g++"
        }
    ]
}

{
    "configurations": [
        {
            "name": "C/C++: g++ build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "lldb",
            "preLaunchTask": "C/C++: g++ build active file"
        }
    ],
    "version": "2.0.0"
}

Debugger Logs

none

Other Extensions

No response

Additional Information

No response

Colengms commented 3 months ago

Hi @eanostman . I believe what you're seeing is a macOS feature and is due to storing your project folder under a macOS 'special' directory (Desktop). If you place it somewhere other than one of the special directories, that should avoid needing to repeatedly provide VS Code (not the C/C++ Extension, per se) with permission.

Closing this issue, since it's not directly related to the C/C++ Extension.

eanostman commented 3 months ago

It looks like that fixes the permission issue. It did not fix the terminal from running. But I was able to find the workaround as stated in the docs:

https://code.visualstudio.com/docs/cpp/config-clang-mac

So it is working now.

Are there any a plans to fix this bug? C# does not do of any this.