-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Environment
- OS and version: Windows 10 home.
- VS Code: 1.103.0
- C/C++ extension: 1.26.3
- OS and version of remote machine (if applicable):
- GDB / LLDB version: GNU gdb (GDB) 15.2
Bug Summary and Steps to Reproduce
Bug Summary: After installing C++ and running the c++ file I am given extra output along with the correct output. This disappears when I adjust the terminal window.
Steps to reproduce:
- In this environment: Windows 10 Home, VS Code 1.103.0, C/C++ extension version 1.26.3, MSYS2 UCRT64 toolchain installed with g++ and gdb at C:/msys64/ucrt64/bin/
- With this config...
launch.json pointing to gdb at "miDebuggerPath": "C:/msys64/ucrt64/bin/gdb.exe", externalConsole: false
tasks.json configured to build with g++
c_cpp_properties.json with "compilerPath": "C:/msys64/ucrt64/bin/g++.exe" and IntelliSense mode set to "windows-gcc-x64"
- Do: Simple code within a file and then use the debug or run C/C++ file on the top right.
- See error... Extra output within the Terminal and under cppdbg: filename.exe
Debugger Configurations
tasks.json
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++.exe build active file",
"command": "C:\\msys64\\ucrt64\\bin\\g++.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++: g++.exe build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:/msys64/ucrt64/bin/gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++.exe build active file"
}
]
}
Debugger Logs
Output: Activating task providers cppbuild
Other Extensions
No response
Additional Information
I am relatively new to programming in general and decided I wanted to learn C++ for my upcoming classes. After installing my C++ compiler and receiving strange output, I have tried looking for what solutions I could find. This output occurs almost every time I try to do any type of code which can be as simple as hello world or printing out a integer. Strangely, when I resize the terminal area the extra output goes away and the correct answer 1 is shown.
This is the code to show my issue:
Below are the pictures of the terminal output and I highlighted in red the extra output which shouldn't be there but the correct number, 1, is there at the beginning.
After resizing the terminal the extra output instantly goes away. As soon as I run another file the extra output is there again unless I resize my terminal.