1. oh-my-posh oh-my-posh 提供 Git 状态颜色编码和提示的完全自定义命令提示符体验提供主题功能。
1.1. 安装 oh-my-posh windows(powershell) 1 2 3 4 5 6 7 8 9 10 11 12 winget install JanDeDobbeleer.OhMyPosh -s wingetSet-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserAdd-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 -scat >> ~/.bashrc <<- 'EOM' eval "$(oh-my-posh init bash) " EOM
1.2. 安装字体 1 2 3 oh-my-posh font install oh-my-posh font install meslo
设置 Windows Terminal 字体
CTRL + SHIFT + ,打开配置文件,加入字体设置:
1 2 3 4 5 6 7 8 9 10 11 12 { "profiles" : { "defaults" : { "font" : { "face" : "MesloLGM Nerd Font" } } } }
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 CurrentUserAdd-Content -Path $PROFILE -Value @' # Terminal-Icons Import-Module -Name Terminal-Icons '@
2.2. 用法 1 2 3 4 5 6 7 Get-Item ./README.mdGet-ChildItem Get-ChildItem | Format-List Get-ChildItem | Format-Wide