如何在 Visual Studio Code 中設定啟動配置的預設終端類型?

如何在 Visual Studio Code 中設定啟動配置的預設終端類型?

我按照官方說明在使用者設定中建立啟動物件:

https://code.visualstudio.com/docs/editor/debugging#_global-launch-configuration

{
    "workbench.startupEditor": "newUntitledFile",
    "editor.minimap.enabled": false,
    "window.titleBarStyle": "native",
    "window.zoomLevel": 0,
    "editor.autoClosingBrackets": "never",
    "editor.autoClosingQuotes": "never",
    "java.configuration.checkProjectSettingsExclusions": false,
    "java.errors.incompleteClasspath.severity": "ignore",
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "terminal.external.linuxExec": "gnome-terminal",
    "terminal.explorerKind": "external",
    "launch": {
        "configurations": [
            {
                "console": "externalTerminal"
            }
        ]
    }
}

當我使用這些設定來運行檔案時,生成的 launch.json 如下所示:

{
    "configurations": [
        {
            "type": "java",
            "name": "CodeLens (Launch) - Dreieck",
            "request": "launch",
            "mainClass": "de.ostfalia.gdp.ss19.s2.Dreieck",
            "projectName": "gdp"
        },
        {
            "console": "externalTerminal"
        }
    ]
}

第二個區塊沒有任何效果,程式碼仍然在預設調試控制台上運行。

它應該會產生一個如下所示的文件:

{
    "configurations": [
        {
            "type": "java",
            "name": "CodeLens (Launch) - Dreieck",
            "request": "launch",
            "mainClass": "de.ostfalia.gdp.ss19.s2.Dreieck",
            "projectName": "gdp",
            "console": "externalTerminal"
        }
    ]
}

我可以做些什麼來讓 vscode 產生這樣的工作啟動檔案嗎?

相關內容