欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Windows Terminal 安装及美化

程序员文章站 2022-07-22 19:50:01
windows terminal 是今年微软Build大会上推出的一款的全新终端,用来代替cmder之类的第三方终端。具有亚克力透明、多标签、Unicode支持(中文,Emoji)、自带等宽字体等这些特性。 现在可以在微软商店里面进行安装,系统要求是win10 1903及以上,不过目前还是previ ......

windows terminal 是今年微软build大会上推出的一款的全新终端,用来代替cmder之类的第三方终端。具有亚克力透明、多标签、unicode支持(中文,emoji)、自带等宽字体等这些特性。
现在可以在微软商店里面进行安装,系统要求是win10 1903及以上,不过目前还是preview的,可能有些bug,但是我用着还没遇到过。

Windows Terminal 安装及美化
点击直接安装即可,先打开来瞅瞅长啥样。
Windows Terminal 安装及美化
说实话看着有点丑,接下来就让我们来美化它吧~

自定义配置

windows terminal提供了许多设置和配置选项,可以对terminal的外观自定义设置。配置文件格式为json,对于程序员来说很友好。
打开设置

{
    "globals" : 
    {
        "alwaysshowtabs" : true,
        "copyonselect" : false,
        "defaultprofile" : "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
        "initialcols" : 120,
        "initialrows" : 30,
        "keybindings" : 
        [
            ...
        ],
        "requestedtheme" : "system",
        "showtabsintitlebar" : true,
        "showterminaltitleintitlebar" : true,
        "worddelimiters" : " ./\\()\"'-:,.;<>~!@#$%^&*|+=[]{}~?\u2502"
    },
    "profiles" : 
    [
        {
            "acrylicopacity" : 0.5,
            "background" : "#012456",
            "closeonexit" : true,
            "colorscheme" : "campbell",
            "commandline" : "powershell.exe",
            "cursorcolor" : "#ffffff",
            "cursorshape" : "bar",
            "fontface" : "consolas",
            "fontsize" : 10,
            "guid" : "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
            "historysize" : 9001,
            "icon" : "ms-appx:///profileicons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png",
            "name" : "windows powershell",
            "padding" : "0, 0, 0, 0",
            "snaponinput" : true,
            "startingdirectory" : "%userprofile%",
            "useacrylic" : false
        },
        ...
    ],
    "schemes" : 
    [
        ...
    ]
}

结构很简单,globals是全局设置,profiles是各个不同的shell的配置,schemes是配色的方案, ms-appx:///xxx 指的是应用程序包的xxx文件,在我电脑上对应的路径是c:\program files\windowsapps\microsoft.windowsterminal_0.4.2382.0_x64__8wekyb3d8bbwe

设置默认shell

"defaultprofile": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}"

将defaultprofile设置成profile的guid值即可,我设置为了wsl的guid

设置字体

"fontface": "dejavu sans mono"

设置背景图

   "acrylicopacity": 0.5,
   "useacrylic": true,
   "backgroundimage": "c:\\users\\kira yoshikage\\pictures\\wallhaven-36230.png",
   "backgroundimageopacity": 0.75,
   "backgroundimagestretchmode": "fill"

设置schemes

{
 "schemes": [
    {
      "name": "campbell",
      "foreground": "#f2f2f2",
      "background": "#0c0c0c",
      "colors": [
        "#0c0c0c",
        "#c50f1f",
        "#13a10e",
        "#c19c00",
        "#0037da",
        "#881798",
        "#3a96dd",
        "#cccccc",
        "#767676",
        "#e74856",
        "#16c60c",
        "#f9f1a5",
        "#3b78ff",
        "#b4009e",
        "#61d6d6",
        "#f2f2f2"
      ]
    },
    {
      "name": "solarized dark",
      "foreground": "#fdf6e3",
      "background": "#073642",
      "colors": [
        "#073642",
        "#d30102",
        "#859900",
        "#b58900",
        "#268bd2",
        "#d33682",
        "#2aa198",
        "#eee8d5",
        "#002b36",
        "#cb4b16",
        "#586e75",
        "#657b83",
        "#839496",
        "#6c71c4",
        "#93a1a1",
        "#fdf6e3"
      ]
    },
    {
      "name": "solarized light",
      "foreground": "#073642",
      "background": "#fdf6e3",
      "colors": [
        "#073642",
        "#d30102",
        "#859900",
        "#b58900",
        "#268bd2",
        "#d33682",
        "#2aa198",
        "#eee8d5",
        "#002b36",
        "#cb4b16",
        "#586e75",
        "#657b83",
        "#839496",
        "#6c71c4",
        "#93a1a1",
        "#fdf6e3"
      ]
    },
    {
      "name": "ubuntu",
      "foreground": "#eeeeec",
      "background": "#2c001e",
      "colors": [
        "#eeeeec",
        "#16c60c",
        "#729fcf",
        "#b58900",
        "#268bd2",
        "#d33682",
        "#2aa198",
        "#eee8d5",
        "#002b36",
        "#cb4b16",
        "#586e75",
        "#657b83",
        "#839496",
        "#6c71c4",
        "#93a1a1",
        "#fdf6e3"
      ]
    },
    {
      "name": "ubuntulegit",
      "foreground": "#eeeeee",
      "background": "#2c001e",
      "colors": [
        "#4e9a06",
        "#cc0000",
        "#300a24",
        "#c4a000",
        "#3465a4",
        "#75507b",
        "#06989a",
        "#d3d7cf",
        "#555753",
        "#ef2929",
        "#8ae234",
        "#fce94f",
        "#729fcf",
        "#ad7fa8",
        "#34e2e2",
        "#eeeeee"
      ]
    }
}

最终结果

Windows Terminal 安装及美化