菜单
菜单
文章目录
  1. 安装Windows Terminal
  2. 配置使用Windows Terminal
    1. 配置PWS
    2. 配置Git bash
    3. 配置SSH
    4. 添加至右键菜单
  3. 美化Windows Terminal
    1. 最终效果

Windows Terminal的使用与简单美化

以下配置和修改仅供参考,不具有普适性;还请阅读微软官方文档进修改。

安装Windows Terminal

安装使用要求系统是win10 1903及以上,直接在微软商店搜索下载安装即可。

Terminal

配置使用Windows Terminal

Windows Terminal提供了许多设置和配置选项,可以对Terminal的外观自定义设置,配置文件格式为json,设置起来还是很友好的。

配置PWS

Win10自带的Windows PowerShell是5.1的,我们需要安装新版的 Windows PowerShell

默认或自定义安装后,打开 Windows Terminal的设置文件

profiles下的 PowerShell 配置修改为

{
// Make changes here to the powershell.exe profile.
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "PowerShell",
"commandline": "D:/Program Files/PowerShell/7-preview/pwsh.exe", // PowerShell的路径
"colorScheme": "Gruvbox Dark", // PowerShell的主题
"backgroundImage" :"D:/xxx/backgroud/Win104k.png", // PowerShell的背景
"hidden": false
},

配置Git bash

先安装Git。

如果你也像我一样使用的是hexo博客,那么Git肯定已经安装好了。

Windows Terminal中打开设置文件

profiles下配置

{  
"guid": "{087a9f7c-b287-422f-a447-93f740bab0a4}",
"name": "Git",
"commandline": "D:/Program Files/Git/bin/bash.exe", // Git bash的路径
"colorScheme": "Gruvbox Dark", // Git终端的主题
"icon" : "D:/xxx/backgroud/bash.png", // Git的图标
"backgroundImage" :"D:/xxx/backgroud/Bg.webp", // Git终端背景
"hidden": false,
"acrylicOpacity": 0.75
},

配置SSH

同样打开在 Windows Terminal中打开设置文件

profiles下配置

{
"acrylicOpacity" : 0.5,
"closeOnExit" : true,
"colorScheme" : "Gruvbox Dark",
"commandline" : "ssh name@IP", // 例如 ssh root@11.10.9.8
"backgroundImage" :"D:/xxx/backgroud/scaled.png",
"cursorColor": "#FFFFFF",
"cursorShape" : "bar",
"fontFace" : "Consolas",
"fontSize" : 14,
"guid" : "{1bc9cb29-ffb1-4acc-8648-77c52193c26a}",
"icon" : "D:/xxx/backgroud/huaweicloud.png",
"historySize" : 9001,
"name" : "Huawei Cloud",
"padding" : "0, 0, 0, 0",
"snapOnInput" : true,
"startingDirectory" : "",
"useAcrylic" : false
},

附加: guid生成器

添加至右键菜单

下载一个Terminal图标

Terminal图标

新建一个.reg注册表文件,其文件内容:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\wt]
@="Open Windows Terminal Here"
"Icon"="D:\\xxx\\backgroud\\terminal.ico" //路径不能有中文

[HKEY_CLASSES_ROOT\Directory\Background\shell\wt\command]
@="C:\\Users\\xxx\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe" //xxx为用户名

双击将值写入注册表即可。

美化Windows Terminal

在schemes处增加主题并调用。

// Add custom color schemes to this array.
// To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
"schemes": [
{
"name": "Gruvbox Dark",
"black": "#1e1e1e",
"red": "#be0f17",
"green": "#868715",
"yellow": "#cc881a",
"blue": "#377375",
"purple": "#a04b73",
"cyan": "#578e57",
"white": "#978771",
"brightBlack": "#7f7061",
"brightRed": "#f73028",
"brightGreen": "#aab01e",
"brightYellow": "#f7b125",
"brightBlue": "#719586",
"brightPurple": "#c77089",
"brightCyan": "#7db669",
"brightWhite": "#e6d4a3",
"background": "#1e1e1e",
"foreground": "#4d4dff"
},
{
"name": "AtomOneLight",
"black": "#000000",
"red": "#de3e35",
"green": "#3f953a",
"yellow": "#d2b67c",
"blue": "#2f5af3",
"purple": "#950095",
"cyan": "#3f953a",
"white": "#bbbbbb",
"brightBlack": "#000000",
"brightRed": "#de3e35",
"brightGreen": "#3f953a",
"brightYellow": "#d2b67c",
"brightBlue": "#2f5af3",
"brightPurple": "#a00095",
"brightCyan": "#3f953a",
"brightWhite": "#ffffff",
"background": "#f9f9f9",
"foreground": "#2a2c33"
},
],

profiles下的各配置中用调用"colorScheme" : "Gruvbox Dark"即可,如上述 各配置项 所示。

更多主题下载: 【Windows Terminal Themes

最终效果

gitbash

cmd

ssh

pwsh

毕竟….ε=ε=ε=┏(゜ロ゜;)┛逃

scl

本文作者: Senorui

本文链接: https://senorui.top/posts/1fd4.html

版权声明: 本站所有文章除特别声明外,均采用【CC BY-NC-ND 4.0】国际许可协议,若转载请注明出处!

支持一下
知识无价,欢迎打赏🍖
  • 微信扫一扫
  • 支付宝扫一扫