【问题标题】:VSCode Intergrated Terminal IssueVSCode 集成终端问题
【发布时间】:2021-11-01 09:39:45
【问题描述】:

添加了一个自定义字体系列以在我的 VSCode 中使用,现在右键单击 -> 在集成终端中打开功能在默认 Powershell 中打开我的所有项目。在添加字体之前,它可以正常打开 Git Bash 中的所有内容作为默认设置。
任何人都可以确定问题吗?我仍然将 Git Bash 作为我的默认配置文件。

{
    "open-in-browser.default": "Google Chrome",
    "git.autofetch": true,
    "git.enableSmartCommit": true,
    "window.zoomLevel": -1,
    "terminal.integrated.profiles.windows": {
        
        "Bash": {
            "path": "bash",
            "args": [
                "-l"
            ],
            "icon": "terminal-bash"
        },
        "PowerShell": {
            "source": "PowerShell",
            "icon": "terminal-powershell"
        },
        "Command Prompt": {
            "path": [
                "${env:windir}\\Sysnative\\cmd.exe",
                "${env:windir}\\System32\\cmd.exe"
            ],
            "args": [],
            "icon": "terminal-cmd"
        },
        "Git Bash": {
            "source": "Git Bash"
        }
    },
    "terminal.integrated.profiles.osx": {

        "bash": {
            "path": "bash",
            "args": [
                "-l"
            ],
            "icon": "terminal-bash"
        },
        "zsh": {
            "path": "zsh",
            "args": [
                "-l"
            ]
        },
        "fish": {
            "path": "fish",
            "args": [
                "-l"
            ]
        },
        "tmux": {
            "path": "tmux",
            "icon": "terminal-tmux"
        },
        "pwsh": {
            "path": "pwsh",
            "icon": "terminal-powershell"
        }
    },
    "terminal.integrated.defaultProfile.windows":  "Git Bash",
    "editor.fontFamily": "Fira Code",
    "editor.fontLigatures": true,
}

【问题讨论】:

  • 我发现设置中的终端更改只有在重新启动 VS Code 后才会生效。所以你可以尝试在设置界面中将其设置为 Git Bash,然后重启 VS 代码(确保关闭所有窗口)。

标签: visual-studio-code


【解决方案1】:

我刚刚遇到了同样的问题,我将 Git Bash 设置为默认设置,但是当我在资源管理器中右键单击文件以在集成终端中打开时,它会在 Powershell 中打开。

尝试将此路径添加到“terminal.integrated.profiles.windows”中的 Git Bash 属性:

 "Git Bash": {
  "path": ["C:\\Program Files\\Git\\bin\\bash.exe"],
   "source": "Git Bash"
 }

这仅修复了使用 Ctrl + ` 时在 Git Bash 中打开新终端的问题(不是右键单击 -> 在新终端中打开),但它可能对您有用。可能在最近的 VS Code 更新中存在错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-08-11
    • 2019-06-12
    • 1970-01-01
    • 1970-01-01
    • 2021-09-12
    • 2023-03-11
    • 2017-06-21
    • 2019-11-01
    相关资源
    最近更新 更多