1. oh-my-posh
oh-my-posh 提供 Git 状态颜色编码和提示的完全自定义命令提示符体验提供主题功能。

1.1. 安装字体
安装 Nerd Font,选择 Cascadia Code NF 字体。
安装方式:下载字体 .zip,解压后,双击对应的 .ttf 文件
1.2. 设置 Windows Terminal 字体
ctrl+,打开配置界面,选择 “配置文件” -> “其他设置” -> “外观” -> “字体” ,设置为 Cascadia Code NF
1.3. 安装 oh-my-posh
windows(powershell)
1 2 3 4 5 6 7 8 9 10 11 12
| winget install JanDeDobbeleer.OhMyPosh -s winget
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Add-Content -Path $PROFILE -Value @' # oh-my-posh oh-my-posh init pwsh | Invoke-Expression
'@
|
wsl(bash)
1 2 3 4 5 6 7 8 9 10
| sudo apt-get install -y unzip curl -s https://ohmyposh.dev/install.sh | bash -s
cat >> ~/.profile <<- 'EOM'
eval "$(oh-my-posh init bash)" EOM
|
2. Terminal-Icons (for Powershell)
Terminal-Icons is a PowerShell module that adds file and folder icons when displaying items in the terminal
2.1. 安装
1 2 3 4 5 6 7 8
| Install-Module -Name Terminal-Icons -Repository PSGallery -Scope CurrentUser
Add-Content -Path $PROFILE -Value @' # Terminal-Icons Import-Module -Name Terminal-Icons
'@
|
2.2. 用法
1 2 3 4 5 6 7
| Get-Item ./README.md
Get-ChildItem
Get-ChildItem | Format-List
Get-ChildItem | Format-Wide
|