Skip to content

Extra unwanted interpreter output within the terminal #13837

@RyanRooney-git

Description

@RyanRooney-git

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:

  1. 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/
  2. 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"

  1. Do: Simple code within a file and then use the debug or run C/C++ file on the top right.
  2. 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:
Image

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.
Image

Image

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.
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions