win10 terminal 折腾!

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/netlogs/article/details/90732020

1 发布

Windows Terminal在Build 2019开发者大会上公布。预计6月下旬出稳定版,目前只能在github上找到源代码
地址:https://github.com/microsoft/Terminal

2 先决条件:

Windows 1903 
1903 SDK 
VS 2017+ 以及相关组件
然后github上源码本地调试....      

but!!! 
调试好麻烦啊emoji
提供一个懒人下载方法..
其实就是大佬编译好了拿来用

3 install

windows 更新到1903 后
下载
压缩包链接 提取码tj7w

安装教程 https://www.bilibili.com/video/av51726432?from=search&seid=4273607785311562676

4 使用教程

安装完成之后就是

在这里插入图片描述

刚开始他是没有那个加号和下拉菜单的, CTRL + T 打开新窗口就可以看到了, 下拉菜单里面可以选择cmd 或者 powershell ,想用linux的话去应用商店下载, 比如,

在这里插入图片描述

下拉菜单里也可以添加进去,但是还不会…

5 配置

下拉菜单里可以settings 打开之后是一个json文件

在这里插入图片描述
其中alwaysShowTabs 和 experimental_showTabsInTitlebar 变量是我手动改成的true, 目的是是他默认就有加号和下拉菜单,然后多个窗口是默认顶部, 自己改下看效果就知道了

colorscheme: 配色方案
defaultProfile: 应该是默认打开哪个, 对应每个的guid

添加其他项

在下拉菜单里添加其他项的话,比如Ubuntu,我们需要guid,查阅资料后发现这个是全局标识码,查了好多资料不会弄,我就自己瞎编了个guid添加到了配置文件里,然后就可以了。。。
在这里插入图片描述
wsl代码块为

{
      "startingDirectory": "C:\\Users\\dragon\\AppData\\Local\\Packages\\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\\LocalState\\rootfs\\",
      "guid": "{8323e74d-0b72-4c97-858f-a94c4ee6dbc1}",
      "name": "wsl",
      "colorscheme": "UbuntuLegit",
      "historySize": 9001,
      "snapOnInput": true,
      "cursorColor": "#FFFFFF",
      "cursorHeight": 25,
      "cursorShape": "vintage",
      "commandline": "wsl.exe",
      "fontFace": "Consolas",
      "fontSize": 12,
      "acrylicOpacity": 0.75,
      "useAcrylic": true,
      "closeOnExit": false,
      "padding": "0, 0, 0, 0",
      "icon": "ms-appdata:///roaming/ubuntu.png"
    }

初始路径的话
C:\Users\“user”\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\
“user” 是个人Windows用户,记得改
不知道为什么进不去用户目录,可能是不支持,,,

图标

上图的wsl是有ubuntu图标的,添加方法就是
"icon": "ms-appdata:///roaming/ubuntu.png"
ubuntu.png是一个32*32的图标

在这里插入图片描述

配色

这个根据个人喜好自行配置

放上我的配置文件

{
  "defaultProfile": "{8323e74d-0b72-4c97-858f-a94c4ee6dbc1}",
  "initialRows": 30,
  "initialCols": 120,
  "alwaysShowTabs": true,
  "showTerminalTitleInTitlebar": true,
  "experimental_showTabsInTitlebar": true,
  "requestedTheme": "dark",
  "profiles": [
    {
      "guid": "{8323e74d-0b72-4c97-858f-a94c4ee6dbc0}",
      "name": "cmd",
      "colorscheme": "Campbell",
      "historySize": 9001,
      "snapOnInput": true,
      "cursorColor": "#FFFFFF",
      "cursorHeight": 25,
      "cursorShape": "vintage",
      "commandline": "cmd.exe",
      "fontFace": "Consolas",
      "fontSize": 12,
      "acrylicOpacity": 0.85,
      "useAcrylic": true,
      "closeOnExit": false,
      "padding": "0, 0, 0, 0"
    },
    {
      "startingDirectory": "C:\\Users\\dragon\\AppData\\Local\\Packages\\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\\LocalState\\rootfs\\",
      "guid": "{8323e74d-0b72-4c97-858f-a94c4ee6dbc1}",
      "name": "wsl",
      "colorscheme": "UbuntuLegit",
      "historySize": 9001,
      "snapOnInput": true,
      "cursorColor": "#FFFFFF",
      "cursorHeight": 25,
      "cursorShape": "vintage",
      "commandline": "wsl.exe",
      "fontFace": "Consolas",
      "fontSize": 12,
      "acrylicOpacity": 0.75,
      "useAcrylic": true,
      "closeOnExit": false,
      "padding": "0, 0, 0, 0",
      "icon": "ms-appdata:///roaming/ubuntu.png"
    },
    {
      "guid": "{bf1d1a7a-acac-41a8-944c-e3019e6adfff}",
      "name": "PowerShell",
      "background": "#012456",
      "colorscheme": "Campbell",
      "historySize": 9001,
      "snapOnInput": true,
      "cursorColor": "#FFFFFF",
      "cursorHeight": 25,
      "cursorShape": "vintage",
      "commandline": "powershell.exe",
      "fontFace": "Courier New",
      "fontSize": 12,
      "acrylicOpacity": 0.5,
      "useAcrylic": false,
      "closeOnExit": false,
      "padding": "0, 0, 0, 0"
    }
  ],
  "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": "UbuntuLegit",
      "foreground": "#EEEEEE",
      "background": "#2C001E",
      "colors": [
        "#4E9A06",
        "#CC0000",
        "#300A24",
        "#C4A000",
        "#3465A4",
        "#75507B",
        "#06989A",
        "#D3D7CF",
        "#555753",
        "#EF2929",
        "#8AE234",
        "#FCE94F",
        "#729FCF",
        "#AD7FA8",
        "#34E2E2",
        "#EEEEEE"
      ]
    }
  ]
}

添加背景图片


"backgroundImage": "ms-appdata:///roaming/bg1.jpg",
"backgroundImageOpacity": 0.75,
"backgroundImageStretchMode": "fill"

这里要把useAcrylic选项改为false,因为图片不能用毛玻璃的形式表现出来/瞎猜

快捷键!

在这里插入图片描述

通过对配置文件添加代码,

"keybindings" : 
        [
            {
                "command" : "closeTab",
                "keys" : 
                [
                    "ctrl+w"
                ]
            },
            {
                "command" : "newTab",
                "keys" : 
                [
                    "ctrl+t"
                ]
            },
            {
                "command" : "newTabProfile0",
                "keys" : 
                [
                    "ctrl+shift+1"
                ]
            }
       ]

大概就是这个亚子

展开阅读全文

没有更多推荐了,返回首页