前置条件:需要在 Windows商店 中下载好 Windows Terminal
基础配置
添加主题和其他终端
打开 Windows Terminal 中的 设置 ,打开后是一个 Json 的配置文件,schemes
节点中的集合为主题集合。
主题可在 https://atomcorp.github.io/themes/ 网站中copy,选择喜欢的主题,然后点击 Get theme
复制到粘贴板。
"schemes": [
{
"name": "WarmNeon",
"black": "#000000",
"red": "#e24346",
"green": "#39b13a",
"yellow": "#dae145",
"blue": "#4261c5",
"purple": "#f920fb",
"cyan": "#2abbd4",
"white": "#d0b8a3",
"brightBlack": "#fefcfc",
"brightRed": "#e97071",
"brightGreen": "#9cc090",
"brightYellow": "#ddda7a",
"brightBlue": "#7b91d6",
"brightPurple": "#f674ba",
"brightCyan": "#5ed1e5",
"brightWhite": "#d8c8bb",
"background": "#404040",
"foreground": "#afdab6",
"selectionBackground": "#b0ad21",
"cursorColor": "#30ff24"
},
{
"name": "Aurora",
"black": "#23262e",
"red": "#f0266f",
"green": "#8fd46d",
"yellow": "#ffe66d",
"blue": "#0321d7",
"purple": "#ee5d43",
"cyan": "#03d6b8",
"white": "#c74ded",
"brightBlack": "#292e38",
"brightRed": "#f92672",
"brightGreen": "#8fd46d",
"brightYellow": "#ffe66d",
"brightBlue": "#03d6b8",
"brightPurple": "#ee5d43",
"brightCyan": "#03d6b8",
"brightWhite": "#c74ded",
"background": "#23262e",
"foreground": "#ffca28",
"selectionBackground": "#292e38",
"cursorColor": "#ee5d43"
}
],
然后给某个终端指定不同的主题。
终端集合在 profiles
节点中,用 colorScheme
字段来指定主题。
"profiles": {
"defaults": {
// Put settings here that you want to apply to all profiles.
},
// 这里就是终端类型的集合,比如 CMD、Git Bash等
"list": [
{
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"hidden": false,
"colorScheme": "Aurora" // 指定现有的主题,值为主题的 name
},
{
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "CMD",
"commandline": "cmd.exe",
"hidden": false
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": false,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b7}",
"hidden": false,
"name": "Git Bash",
"commandline": "C:\\Program Files\\Git\\bin\\bash.exe",
"icon": "C:\\Program Files\\Git\\git.png"
}
]
},
配置右键菜单
打开注册表
win+R 快捷键打开“运行”窗口,输入regedit
点击“确定”即可打开注册表编辑器。
创建注册表项
在[HKEY_CLASSES_ROOT\Directory\Background\shell\]
下新建一个名为:Windows Terminal
的项。
右击 Windows Terminal
项 新建 字符串值
名为 Icon
,值为 Icon 文件所在的目录,如:C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps\\wt_32.ico
右击 Windows Terminal
项,新建名为command
的项,然后选择 默认
的 字符串值,设置值为:C:\Users\{自己的用户名}\AppData\Local\Microsoft\WindowsApps\\wt.exe
eg:图标可在阿里矢量图标库中下载