vscode-cpptools
vscode-cpptools copied to clipboard
[cppdbg] Integrated Terminal not working
Environment
- OS and version: M1 macOS 13.0
- VS Code: 1.73.0
- C/C++ extension: v1.12.4
Bug Summary
Can't show output in integrated terminal instead of debug console, even if I set "avoidWindowsConsoleRedirection": to false.
want to know how to show the output in the integrated terminal? thanks a lot.
Debugger Configurations
// my launch.json file
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++: clang++ build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/output/${fileBasenameNoExtension}",
"args": [],
"cwd": "${workspaceFolder}",
"environment": [],
"MIMode": "lldb",
"preLaunchTask": "C/C++: clang++ build active file",
"avoidWindowsConsoleRedirection": false,
}
]
}
You will need to add "externalConsole": false, to not use an external console for output.
You will need to add
"externalConsole": false,to not use an external console for output.
I have tried this before, but it still show the output in the debug console, not the integrated console.
The attribute description of "externalConsole" says "If true, a console is launched for the debuggee. If false, on Linux and Windows, it will appear in the Integrated Console." , so maybe it is not work on macOS?
// my launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++: clang++ build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/output/${fileBasenameNoExtension}",
"args": [],
"cwd": "${workspaceFolder}",
"environment": [],
"MIMode": "lldb",
"preLaunchTask": "C/C++: clang++ build active file",
"avoidWindowsConsoleRedirection": false,
"externalConsole": false,
}
]
}
Hey guys I encountered the same issue on a MacBook Pro with M1 Pro chip. Is there any workarounds about this? By the way, the integrated terminal runs flawlessly on both Linux and Windows. Is it some macOS safety measures messing about?
I also encountered this today. It is curious that the description does not mention what happens on macOS and why it is so different; I am debugging a program that receives stdin and the only way to type that in is through an external terminal, which is annoying.
@Charles-IX @corwin-of-amber
Hi, I found a workaround,
- Install a extension named CodeLLDB, a native debugger powered by LLDB.
- Modify the "type" property in the "launch.json", change "cppdbg" to "lldb".
- You will find some property in launch.json not allowed, remove them.
Then the output can show in integrated terminal.
// launch.json
{
"configurations": [
{
"name": "C/C++: clang++ build and debug active file",
"type": "lldb",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"cwd": "${fileDirname}",
"preLaunchTask": "C/C++: clang++ build active file",
}
],
"version": "2.0.0"
}