应用商店中搜索, 下载
https://github.com/PowerShell/PowerShell/releases
Sarasa[更纱黑体]
https://github.com/be5invis/Sarasa-Gothic
这里是搬运地址:
https://download.csdn.net/download/MAIMIHO/12490128
安装 Sarasa Term SC
打开 Windows terminal
设置, 替换如下, 注意里面的路径替换为自己的
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{195e5e70-802f-4ae6-a4e6-57eff2b90258}",
"copyOnSelect": false,
"copyFormatting": false,
"theme": "dark",
"launchMode": "maximized",
"snapToGridOnResize": false,
"profiles": {
"defaults": {
"colorScheme": "Dracula",
//背景透明度,
"acrylicOpacity": 0.8,
// 启用毛玻璃,
"useAcrylic": true,
//背景图片,
"backgroundImage": "你的背景图片路径",
//图片透明度,
"backgroundImageOpacity": 0.5,
//填充模式,
"backgroundImageStretchMode": "fill",
//字体,
"fontFace": "Sarasa Term SC",
//文字大小,
"fontSize": 14,
//光标颜色,
"cursorColor": "#FFFFFF",
//光标形状,
"cursorShape": "bar",
"startingDirectory": ".",
"antialiasingMode": "cleartype"
},
"list": [
{
"guid": "{195e5e70-802f-4ae6-a4e6-57eff2b90258}",
"name": "PowerShell Core",
"icon": "C:\\Dev\\PowerShell\\assets\\Powershell_av_colors.ico",
"commandline": "C:\\Dev\\PowerShell\\pwsh.exe -nologo",
"hidden": false
},
{
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"hidden": false
},
{
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "命令提示符",
"commandline": "cmd.exe",
"hidden": false
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": false,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
}
]
},
"schemes": [
{
"name": "Dracula",
"background": "#272935",
"black": "#21222C",
"blue": "#BD93F9",
"cyan": "#8BE9FD",
"foreground": "#F8F8F2",
"green": "#50FA7B",
"purple": "#FF79C6",
"red": "#FF5555",
"white": "#F8F8F2",
"yellow": "#FFB86C",
"brightBlack": "#6272A4",
"brightBlue": "#D6ACFF",
"brightCyan": "#A4FFFF",
"brightGreen": "#69FF94",
"brightPurple": "#FF92DF",
"brightRed": "#FF6E6E",
"brightWhite": "#F8F8F2",
"brightYellow": "#FFFFA5"
}
],
"keybindings": [
{
"command": {
"action": "copy",
"singleLine": false
},
"keys": "ctrl+c"
},
{
"command": "paste",
"keys": "ctrl+v"
},
{
"command": "find",
"keys": "ctrl+shift+f"
},
{
"command": {
"action": "splitPane",
"split": "auto",
"splitMode": "duplicate"
},
"keys": "alt+shift+d"
}
]
}
##允许执行脚本
set-executionpolicy remotesigned
遇到提示统一选 是
Y
Install-Module -Name PSReadLine -AllowPrerelease -Force
Install-Module git-aliases -AllowClobber
Install-Module posh-git
Install-Module oh-my-posh
Install-Module DirColors
code $PROFILE (notpad $PROFILE) # VSCode or 记事本打开
Import-Module DirColors
Import-Module posh-git
Import-Module oh-my-posh
Import-Module git-aliases -DisableNameChecking
Set-Theme PowerLine
#------------------------------- Set Hot-keys BEGIN -------------------------------
# 设置 Tab 键补全
# Set-PSReadlineKeyHandler -Key Tab -Function Complete
# 设置 Tab 为菜单补全和 Intellisense
Set-PSReadLineKeyHandler -Key "Tab" -Function MenuComplete
# 设置 Ctrl+d 为退出 PowerShell
Set-PSReadlineKeyHandler -Key "Ctrl+d" -Function ViExit
# 设置 Ctrl+z 为撤销
Set-PSReadLineKeyHandler -Key "Ctrl+z" -Function Undo
# 设置向上键为后向搜索历史记录
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
# 设置向下键为前向搜索历史纪录
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
# 一些PSReadline配置
$PSReadLineOptions = @{
EditMode = "Windows"
HistoryNoDuplicates = $true
HistorySearchCursorMovesToEnd = $true
ShowToolTips = $true
Colors = @{
# 提示文字颜色,原来的颜色太浅了,我这里换了
Prediction = '#888888'
}
}
Set-PSReadLineOption @PSReadLineOptions
#------------------------------- Set Hot-keys END -------------------------------
win+r 输入 regedit 计算机\HKEY_CLASSES_ROOT\Directory\Background\shell
shell
下新建 项
wt
wt
默认
值 Open Windows Terminal here
wt
下 新建 字符串值
Icon
值 C:\Dev\PowerShell\assets\Powershell_av_colors.ico
wt
下 新建 项
command
值 C:\Users\[你的用户名]\AppData\Local\Microsoft\WindowsApps\wt.exe
参考
https://github.com/dracula/windows-terminal
https://docs.microsoft.com/zh-cn/windows/terminal/
https://www.chuchur.com/article/windows-terminal-beautify
https://zhuanlan.zhihu.com/p/137595941
https://blog.csdn.net/zaoandly/article/details/106415873