Sign in

Vscode debugging C program prompt unable to perform this action because?

rdkdh edited in Wed, 25 Jan 2023

I use vscode + WSL to match the C development environment, according to the online said with good launch.json and tasks.json , launch.json If the value of externalconsole is true, why don't you pop up the debug box as mentioned on the Internet, but still input and output the debug console at the bottom? launch.json :

    "version": "0.2.0",
    "configurations": [
            "name": "gcc - 生成和调试文件",
            "type": "cppdbg",
            "request": "launch",
            "program": "/mnt/e/Code/CTest/${fileBasenameNoExtension}.o",
            //"args": ["-fThreading"],
            "args": [],
            "stopAtEntry": false,
            "cwd": "/mnt/e/Code/CTest",
            "environment": [],
            "externalConsole": true,
            //"internalConsoleOptions": "openOnSessionStart",
            "preLaunchTask": "gcc 编译文件",
            "windows": {
                "MIMode": "gdb",
                "setupCommands": [
                        "description": "Enable pretty-printing for gdb",
                        "text": "-enable-pretty-printing",
                        "ignoreFailures": true
            "pipeTransport": {
                "pipeCwd": "",
                "pipeProgram": "c:\\windows\\sysnative\\bash.exe",//通常不需要修改
                "pipeArgs": ["-c"],
                "debuggerPath": "/usr/bin/gdb"
            "sourceFileMap": {
                "/mnt/e": "E:\\"//地址转换
0 Replies