【问题标题】:how to configure VSCode to use oh-my-zsh in Ubuntu 18.04?如何在 Ubuntu 18.04 中配置 VSCode 以使用 oh-my-zsh?
【发布时间】:2019-02-08 01:51:34
【问题描述】:

我正在尝试将 oh-my-zsh 配置为我的 vscode 的集成终端。

下面是我的用户配置

{
    "editor.fontSize": 12,
    "editor.tabSize": 2,
    "editor.wordWrap": "on",
    "editor.minimap.enabled": false,
    "workbench.iconTheme": "vscode-icons",
    "terminal.integrated.fontSize": 12,
    "window.zoomLevel": 0,
    "vsicons.dontShowNewVersionMessage": true,
    "terminal.integrated.shell.linux": "/bin/zsh"
} 

但是每当我尝试打开集成终端时,它都会抛出一个错误提示 The terminal process command '/bin/zsh' failed to launch (exit

OS : Ubuntu 18.04
VSCode : 1.26.1

echo $SHELL 的输出是/bin/zsh

我也尝试了值zsh/usr/bin/zsh,但得到了同样的错误。

/bin/bash 也是如此

我还需要做什么?

【问题讨论】:

  • 你在制作/bin/zsh这一行后是否退出了Code并重新启动?我在我的 Mac 上尝试过,但我必须重新启动 VScode 才能使更改生效。
  • 我做了,但没用。
  • 毕竟尝试我重新安装了 VSCode,是的!现在它的工作。

标签: ubuntu visual-studio-code oh-my-zsh


【解决方案1】:

要解决您的问题,请在终端中运行命令

which zsh

然后在 VSC 中,替换

"terminal.integrated.shell.linux": "/bin/zsh"

"terminal.integrated.shell.linux": "{the location your terminal pointed to}"

【讨论】:

    【解决方案2】:

    适用于 Linux 的 Windows 子系统 (WSL) 中:

    1. 开始VSCode
    2. F1
    3. 输入user settings
    4. 点击按钮打开设置json
    5. 编辑或添加行:
    "terminal.integrated.shell.osx": "/usr/local/bin/zsh",
    "terminal.integrated.shellArgs.windows": [
        "-c",
        "zsh"
    ],
    
    1. 重启VSCode

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-11
      相关资源
      最近更新 更多