我在电脑上安装了fish shell,现在无法打开VS code终端

Ger*_*cca 7 shell terminal fish visual-studio-code

我在计算机上安装了fish shell,现在无法打开VS code终端。

当我尝试在 VS code 上打开终端时,出现以下错误:“终端进程无法启动:shell 可执行文件“/usr/bin/fish”的路径不存在。”

我从外部 VS code 打开终端没有任何问题。当我在其上输入 echo "$SHELL" 命令时,我得到/usr/bin/fish这正是 VS code 无法找到的路径。

我该如何解决这个问题?我用的是ubuntu。

Cal*_*leb 22

我也有同样的问题。问题是 VSC 默认情况下仅在 /usr/bin 中查找 shell。我复制了默认终端设置并更新fishbrew安装位置:/usr/local/bin

"terminal.integrated.profiles.osx": {
    "bash": {
        "path": "bash",
        "args": [
            "-l"
        ],
        "icon": "terminal-bash"
    },
    "zsh": {
        "path": "zsh",
        "args": [
            "-l"
        ]
    },
    "fish": {
        "path": "/usr/local/bin/fish", // overriding
        "args": [
            "-l"
        ]
    }
},
Run Code Online (Sandbox Code Playgroud)

这对于其他操作系统应该是相同的,您只需要 linux 或 windows 而不是 osx。

在 VS Code 终端中运行的鱼

要进行该设置,请打开您的设置(在 mac 上使用 cmd 逗号,在其他地方使用 ctrl 逗号),搜索终端配置文件: 设置搜索 然后单击 settings.json 中的编辑。它应该将您带到正确的位置以粘贴这些配置文件。