Windows
本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →
终端环境配置
虽然 Oh My Posh 能在标准终端运行,但我们建议使用 Windows Terminal。
要完整显示所有图标,推荐安装 Nerd Font 字体。
在 WSL 环境中使用 oh-my-posh 时,请确保遵循 Linux 安装指南。
安装步骤
- winget
- manual
- chocolatey
Open a PowerShell prompt and run the following command:
winget install JanDeDobbeleer.OhMyPosh --source winget
Open a PowerShell prompt and run the following command:
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))
The chocolatey package is maintained by the community and might not be up to date. In case of issues, please contact the maintainer.
Open a PowerShell prompt and run the following command:
choco install oh-my-posh
本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →
下一步
Oh My Posh 已安装完毕,接下来你可以配置终端和 shell,让命令行提示符完全按照你的心意显示。
-
安装一个字体
-
配置终端/编辑器使用已安装的字体
-
配置 shell 以启用 Oh My Posh
-(可选)配置主题或自定义提示符配置
更新方法
- winget
- manual
- chocolatey
Open a PowerShell prompt and run the following command:
winget upgrade JanDeDobbeleer.OhMyPosh --source winget
Open a PowerShell prompt and run the following command:
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))
The chocolatey package is maintained by the community and might not be up to date. In case of issues, please contact the maintainer.
Open a PowerShell prompt and run the following command:
choco upgrade oh-my-posh