【问题标题】:How can I Customize Visual Studio Code terminal?如何自定义 Visual Studio Code 终端?
【发布时间】:2021-02-01 23:47:03
【问题描述】:

如何自定义我的 Visual Studio Code 终端,使其看起来像这样?

我当前的终端

【问题讨论】:

  • 这能回答你的问题吗? Color theme for VS Code integrated terminal
  • 不,它没有。就是改变集成终端的颜色。矿山终端完全不同
  • 那你指的是什么样的终端?
  • 我已经在问题中展示了
  • 问题中终端的图片是集成终端的图片。我的重复问题有一个集成终端的解决方案。所以我不明白你所指的区别。

标签: visual-studio-code


【解决方案1】:

要在 VS Code 中更改集成终端的外观,您需要编辑 settings.json 文件。这是您可以访问该文件的方式:

Windows/Linux:文件 > 首选项 > 设置。或者,您可以按ctrl + shift + P 打开Preferences: Open Settings (JSON)

MacOs:代码 > 首选项 > 设置。或者,您可以按:

  • 快捷方式 (⌘)
  • 搜索 (⇧⌘P) → “偏好设置:打开设置”

然后搜索工作台>外观>颜色自定义。您将找到您的 settings.json 文件。对文件进行编辑。

你会发现:

"workbench.colorCustomizations": {
        # Add your theme here    
    }

示例主题可以是:

      "terminal.background":"#1D2021",
      "terminal.foreground":"#A89984",
      "terminalCursor.background":"#A89984",
      "terminalCursor.foreground":"#A89984",
      "terminal.ansiBlack":"#1D2021",
      "terminal.ansiBlue":"#0D6678",
      "terminal.ansiBrightBlack":"#665C54",
      "terminal.ansiBrightBlue":"#0D6678",
      "terminal.ansiBrightCyan":"#8BA59B",
      "terminal.ansiBrightGreen":"#95C085",
      "terminal.ansiBrightMagenta":"#8F4673",
      "terminal.ansiBrightRed":"#FB543F",
      "terminal.ansiBrightWhite":"#FDF4C1",
      "terminal.ansiBrightYellow":"#FAC03B",
      "terminal.ansiCyan":"#8BA59B",
      "terminal.ansiGreen":"#95C085",
      "terminal.ansiMagenta":"#8F4673",
      "terminal.ansiRed":"#FB543F",
      "terminal.ansiWhite":"#A89984",
      "terminal.ansiYellow":"#FAC03B"

从 VS Code here 中查找自定义文档。更多here

【讨论】:

  • 它只会改变终端的颜色。请告诉我如何让我的终端看起来像我在问题中给出的图片
【解决方案2】:

从第一张截图来看,这应该是从安装了Oh My Zsh 框架的 Linux 或 MacOS 终端上截取的。该框架允许对终端进行自定义主题化。不幸的是,这个框架是 Z shell 终端独有的,只能在 Linux 和 MacOS 上使用。

幸运的是,有一个适用于 Windows 用户的解决方法。 Windows 引入了适用于 Linux 的 Windows 子系统 (WSL),它允许您在 Windows 上运行 Linux。请read the docs here 了解如何在您的 Windows 上安装 WSL 系统。在您的系统上安装 WSL 后,check out this guide 显示了在您的 WSL 系统上安装 Z Shell 并在 shell 中安装 Oh My Zsh 框架的步骤。

最后,转到 VS Code 并将默认终端设置为您的 WSL Z shell 终端。您可以查看this short article了解更多详情。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-02
    • 2017-09-16
    • 2018-05-16
    相关资源
    最近更新 更多