Window Terminal

经历了打开cmd、git以及各种远程连接的摧残(界面伤眼、切换、记IP地址、各种输入等),想找一个比cmd好看,可以同时打开多个以上我想打开的所有shell界面的应用,终于找到一个Window Terminal来满足我的期待。

简介

官网比我说得好,请移步

安装

windows应用商店里搜索即可安装

简单配置

须知

  1. 通过Window Terminal的profiles.json来配置

  1. 每配置一种类型的命令行界面都需要一个不同的guid,可以通过Create GUIDs online生成

  2. 配置文件配置项说明

    属性 释义 说明
    alwaysShowTabs 始终显示标签
    defaultProfile 默认终端 GUID,用于连接终端配置
    initialCols 默认列数
    initialRows 默认行数
    keybindings 快捷键配置
    command 快捷键执行的命令
    keys 快捷键
    requestedTheme 主题
    showTabsInTitlebar 在标题栏中显示终端窗口标签栏
    showTerminalTitleInTitlebar 在标签栏中显示终端标签
    acrylicOpacity 不透明度
    closeOnExit 退出后关闭
    colorScheme 颜色主题
    commandline 命令行程序
    cursorColor 光标颜色
    cursorShape 光标形状
    fontFace 字体
    fontSize 字体大小
    guid GUID 终端配置标识
    historySize 历史大小
    icon 图标
    name 名称
    padding 内容距离界面的内部距离
    snapOnInput 嗅探输入
    startingDirectory 初始目录
    useAcrylic 使用不透明度

配置git

1. 配置:cmd下通过bash命令打开git命令行

  • 打开环境变量配置

  • 配置Path

  • cmd下打开git

2. 配置Window Terminal的profile.json

profiles属性值的数组里添加以下json

{
    "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6109}", // GUID,终端配置标识,每个都必须不一样
    "commandline": "bash.exe",  // 命令
    "name": "git-bash", // 给它一个名字来与其他界面分开
    "tabTitle": "Git Bash",  // 给它一个标签页的名字
    "snapOnInput": true,  // 捕捉输入
    "startingDirectory": "%USERPROFILE%",  // 打开当前用户根目录
    "historySize": 9001,  // 历史大小
    "closeOnExit": true,  // 退出后关闭
    "icon": "D:/Program Files/Git/mingw64/share/git/git-for-windows.ico"  // 其实是安装Git以后自带的icon
}

配置SSH

1. 配置远程连接

  • 配置公钥密钥

    Linux下可以直接通过shell命令配置,Window下通过Git的git bash来完成类似shell命令的功能

    ssh-keygen -t rsa

  • 配置远程连接文件

    C:Users11064.ssh目录下,11064是我的用户名,新建config命名的文件(没有后缀名),配置远程连接

2. cmd下可以远程连接

3. 配置profiles.json

{
    "guid": "{9a138488-58fc-4a7a-b3c2-3af9ba5bc7bb}",
    "commandline": "ssh fengzi",
    "name": "aliyun-Ubuntu",
    "tabTitle": "aliyun-Ubuntu",
    "snapOnInput": true,
    "historySize": 9001,
    "closeOnExit": true,
    "icon": "C:/Users/11064/.ssh/icon/ubuntu-icon.png"   // 自己找的一个图标
}

配置背景图片

最喜欢的配置项

profiles.json里的power shell配置项为例

{
      // Make changes here to the powershell.exe profile
      "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
      "name": "power shell",
      "commandline": "powershell.exe",
      "hidden": false,
      "useAcrylic": true, // 使用不透明度
      "backgroundImage": "C:/Users/11064/Desktop/vscode_bc/ab2bff80gy1g7oxngj7whj21900u0go6.jpg", // 背景图片
      "backgroundImageOpacity": 0.6,  // 背景图片不透明度
      "backgroundImageAlignment": "topleft",  // 背景图片位置
      "foreground": "#FFFFFF",   // 前景颜色?
      "tabTitle": "power Shell",
      "startingDirectory": "./"
    },

分享我的界面

配置主题颜色

  1. mbadolato iTerm2-Color-Schemes中选择自己喜欢的颜色主题

  2. windowsterminal文件夹中打开自己喜欢的主题的json文件

  3. 复制主题的json配置到profiles.json中的 schemes 配置项中

    "schemes": [{
      "name": "Day",
      "black": "#000000",
      "red": "#b87a7a",
      "green": "#7ab87a",
      "yellow": "#b8b87a",
      "blue": "#7a7ab8",
      "purple": "#b87ab8",
      "cyan": "#7ab8b8",
      "white": "#d9d9d9",
      "brightBlack": "#262626",
      "brightRed": "#dbbdbd",
      "brightGreen": "#bddbbd",
      "brightYellow": "#dbdbbd",
      "brightBlue": "#bdbddb",
      "brightPurple": "#dbbddb",
      "brightCyan": "#bddbdb",
      "brightWhite": "#ffffff"
    },{
      "name": "Night",
      "black": "#000000",
      "red": "#ff7092",
      "green": "#00fbac",
      "yellow": "#fffa6a",
      "blue": "#00bfff",
      "purple": "#df95ff",
      "cyan": "#86cbfe",
      "white": "#ffffff",
      "brightBlack": "#000000",
      "brightRed": "#ff8aa4",
      "brightGreen": "#21f6bc",
      "brightYellow": "#fff787",
      "brightBlue": "#1bccfd",
      "brightPurple": "#e6aefe",
      "brightCyan": "#99d6fc",
      "brightWhite": "#ffffff"
    }],
    
  4. 将主题的名字配置到界面的配置中,比如 powershell

    "profiles": [{
        // Make changes here to the powershell.exe profile
        "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
        "name": "power shell",
        "commandline": "powershell.exe",
        "hidden": false,
        "tabTitle": "power Shell",
        "startingDirectory": "./",
        "colorScheme" : "Night"
    }]
    
原文地址:https://www.cnblogs.com/fengzzi/p/12212723.html