oh-my-push安装
69
参考资料
官方文档:Introduction | Oh My Posh
博客文章:Windows 中安装配置终端Oh-my-posh - 凉皮也是菜 - 博客园
安装过程
用管理员身份打开 powershell
选择手动安装,因为
winget
有一些奇怪的问题
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))
运行 oh-my-push 初始化命令
New-Item -Path $PROFILE -Type File -Force
打开配置文件
notepad $PROFILE
在配置文件中配置主题
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\aliens.omp.json" | Invoke-Expression
其中 aliens.omp.json
为主题配置文件 aliens
为主题名称
主题配置文件存放文件夹为 C:\Users\用户名\AppData\Local\Programs\oh-my-posh\themes
主题样式参考官方文档:Themes | Oh My Posh
配置完成后重新打开终端即可生效
修改 windows 执行策略,否则会报无法读取文件的权限问题
Set-ExecutionPolicy Unrestricted