Type: Bug Extension: Microsoft C/C++ (ms-vscode.cpptools) 1.32.2 Environment: - VS Code: 1.129.1 - Commit: 8a7abeba6e03ea3af87bfbce9a1b7e48fed567b8 - macOS: 26.5.2 (Build 25F84) - Architecture: Apple Silicon / arm64 - Compiler: Apple clang++ - Debugger c
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
Type: Bug
Extension:
Microsoft C/C++ (ms-vscode.cpptools) 1.32.2
Environment:
- VS Code: 1.129.1
- Commit: 8a7abeba6e03ea3af87bfbce9a1b7e48fed567b8
- macOS: 26.5.2 (Build 25F84)
- Architecture: Apple Silicon / arm64
- Compiler: Apple clang++
- Debugger configuration: cppdbg with LLDB
Bug summary:
When running an interactive C++ console program using cppdbg with
"externalConsole": false, the pre-launch clang++ task completes successfully,
but the executable does not start in the integrated terminal.
The terminal displays "Build finished successfully," but the program's first
prompt never appears. VS Code then shows an active debug session even though
there is no running debuggee. Repeating the operation creates multiple stuck
debug sessions.
The Debug Console remains blank.
The same program works correctly when:
1. Compiled and executed directly from a shell.
2. Executed through a VS Code build-and-run task without cppdbg.
3. "externalConsole" is changed to true.
This appears to isolate the problem to the cppdbg-to-integrated-terminal
launch handoff on macOS.
Steps to reproduce:
1. Create this simple interactive C++ program:
#include
using namespace std;
int main()
{
int number = 0;
cout << "Please enter a number: ";
cin >> number;
cout << "You entered: " << number << endl;
return 0;
}
2. Configure the build task:
{
"type": "cppbuild",
"label": "C/C++: clang++ build active file",
"command": "/usr/bin/clang++",
"args": [
"-std=c++17",
"-Wall",
"-Wextra",
"-pedantic",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
]
}
3. Configure cppdbg:
{
"name": "C/C++: clang++ 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++: clang++ build active file"
}
4. Open the C++ source file.
5. Select "Run C/C++ File" from the upper-right play button.
6. Wait for the build task to finish.
Expected result:
After the successful build, the executable should start in the VS Code
integrated terminal. The prompt should appear and accept keyboard input.
Actual result:
- The build finishes successfully.
- The integrated terminal continues showing only the build-task output.
- The program prompt never appears.
- The debuggee is not running.
- The Debug Console is blank.
- VS Code reports one active debug session.
- Repeating the operation creates additional stuck debug sessions.
Relevant VS Code terminal log:
[error] Exception occurred during xterm disposal [{}]
This error occurred repeatedly, including:
2026-07-22 04:26:03.699
2026-07-22 04:36:57.967
2026-07-22 04:37:34.368
Verification performed:
- The source compiles cleanly with:
clang++ -std=c++17 -Wall -Wextra -pedantic -g
- Running the resulting executable directly works correctly.
- A VS Code task that builds and directly runs the executable works correctly
in the integrated terminal.
- Changing "externalConsole" from false to true successfully launches the
program in an external macOS Terminal window.
Workaround:
Set:
"externalConsole": true
Alternatively, execute the program through a direct build-and-run task instead
of cppdbg.
Possibly related:
microsoft/vscode-cpptools#10110 discusses cppdbg integrated-terminal behavior
on Apple Silicon macOS, but this report includes the additional symptoms of
stuck debug sessions and repeated xterm disposal errors on current versions.
Contributor guide
Assessment
This issue has not been assessed yet.