【问题标题】:VSCode internal terminal for C not taking any inputC的VSCode内部终端不接受任何输入
【发布时间】:2021-04-03 00:18:21
【问题描述】:

我在 ubuntu 18.04 上工作,预装了 gcc,VSCode 作为默认编辑器,我可以轻松地构建和调试我的代码,直到昨晚我突然意识到我的终端(VSCode 中的内部终端)不接受任何输入。 我从一个朋友那里得到了 launch.json 和 tasks.json 文件,他的 VSCode 运行良好,但不幸的是没有任何区别

This is My launch.json file
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "gcc - Build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "C/C++: gcc build active file",
            "miDebuggerPath": "/usr/bin/gdb"
        }
    ]
} 

And Here's the tasks.json file:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: gcc build active file",
            "command": "/usr/bin/gcc",
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "/usr/bin"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind" : "build",
                "isDefault": true
            },
            "detail": "compiler: /usr/bin/gcc"
        }
    ]
}

请帮忙,我真的不知道该怎么办。

【问题讨论】:

    标签: c linux gcc visual-studio-code terminal


    【解决方案1】:

    我只是重新安装了 VSCode,删除了 tasks.json 和 launch.json,将整个工作区(仅 C 文件)移动到另一个位置,再次打开文件夹,构建了一个文件并工作了!
    这种方法我试过一次,虽然一开始没用!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-02-17
      • 2022-11-16
      • 2016-01-24
      • 1970-01-01
      • 2012-10-18
      • 2021-10-18
      • 2014-03-02
      • 1970-01-01
      相关资源
      最近更新 更多