admin管理员组

文章数量:1321074

Environment details:

  • Window 11 23H2
  • WSL2 (WSL version: 2.3.26.0, Kernel version: 5.15.167.4-1)
  • Debian GNU/Linux 12 (bookworm)
  • VS Code 1.96.4
  • VS Extension: WSL 0.88.5
  • VS Extension: C/C++ IntelliSense, debugging, and code browsing (Microsoft) 1.23.3 <- Tried both release and pre-release
  • VS Extension: CMake Tools (Microsoft) 1.19.52
  • VS Extension: CMAKE (twxs) 1.23.3
  • GCC (Debian 12.2.0-14) 12.2.0
  • GNU gdb (Debian 13.1-3) 13.1
//launch.json
{
    "version": "0.2.0",
    "configurations": [
        {

            "name": "WSL Debug - C",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "internalConsoleOptions": "neverOpen",
            "externalConsole": false,
            "pipeTransport": {
                "pipeCwd": "",
                "pipeProgram": "/usr/bin/bash",
                "pipeArgs": ["-c"],
                "debuggerPath": "/usr/bin/gdb"
            },
            "logging": {  //Suggested by AI model to disable this output message
                "engineLogging": false,
                "trace": false
            },
            "miDebuggerPath": "/usr/bin/gdb",
            "miDebuggerArgs": "-q -ex quit; wait() { fg >/dev/null; }; /bin/gdb -q --interpreter=mi", // This work around was suggested here: 
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}
//tasks.json
{
    "problemMatcher": [
        "$gcc"
    ],
    "version": "2.0.0",
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: gcc build active file",
            "command": "/usr/bin/gcc",
            "args": [
                "-fdiagnostics-color=always",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}",
                "runOptions": {
                    "runInForeground": true   //Suggested by AI model his point that VS runs the debugging task in the background and passing the information to the debugger confuses the terminal and results in this output
                }
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "Task generated by Debugger."
        }
    ]
}
//main.c
#include <stdio.h>

int main(void)
{
    printf("Hello World\n");
    return 0;
}
//terminal output

Hello World
[1] + Done                       "/usr/bin/gdb" --interpreter=mi --tty=${DbgTerm} 0<"/tmp/Microsoft-MIEngine-In-cjfytvwt.zvp" 1>"/tmp/Microsoft-MIEngine-Out-g1n3f4z2.qzi" //The parts after -In- and -Out- changes every build

After trying this solutions (ones that are commented out), I get the same annoying output on and on . What I want is to disable it.

本文标签: