0

All my friends have their debugger in VS Code working fine except for me, they all don't use a Mac. Any help is appreciated, thanks.

When I am in debug mode in VS Code (Mac), my interactive terminal does not work. cppdbg terminal does not show up and instead the terminal window stays at "terminal will be reused by tasks, press any key to close it", in the Tasks-C/C++: gcc build active file. I have attached screenshots of my terminal and also pasted my launch.json.

I have also attached a screenshot of my friend's vs code where their cppdbg terminal window shows up after the terminal window "terminal will be reused by tasks, press any key to close it" pops up.

However, in my case the terminal window stays at "terminal will be reused by tasks, press any key to close it" and no cppdbg terminal pops up.

Mine, broken:

Screenshot of terminal, "terminal will be reused by tasks, press any key to close it", cppdbg terminal window does not show

My friend's, working:

Screenshot of my friends's vs code where the cppdbg terminal shows

My launch.json file:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "gcc - Build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "lldb",
            "preLaunchTask": "C/C++: gcc build active file"
        }
    ]
}
tripleee
  • 175,061
  • 34
  • 275
  • 318
  • have you taken a look at your friend's `launch.json`. Or simply checked the `launch.json` docs right [here](https://code.visualstudio.com/docs/cpp/launch-json-reference). Or even simply do what the terminal tells you to do, which is "press any key"? – Chase Oct 28 '20 at 08:04
  • Does this answer your question? [How to get rid of "Terminal will be reused by tasks, press any key to close it." behaviour?](https://stackoverflow.com/questions/47946868/how-to-get-rid-of-terminal-will-be-reused-by-tasks-press-any-key-to-close-it) – Chase Oct 28 '20 at 08:06

2 Answers2

1

I cannot get debugging to work with ccpdbg either on Catalina, but it works with the extension called CodeLLDB https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb

luceric
  • 567
  • 4
  • 5
0

It looks like normal for macOS.

See this guide: Using Clang in Visual Studio Code

It seems to me, VSCode C++ is not production ready for macOS.


In C/C++ for Visual Studio Code 1.0.1, simple "cin >> str" code locks up the debugger.

9dan
  • 4,222
  • 2
  • 29
  • 44