shu*_*235 13 windows powershell oh-my-posh
所以我尝试为 Windows 安装 oh-my-posh
Install-Module oh-my-posh -Scope CurrentUser
并输入
Get-PoshThemes
查看我下载的可用主题。但我收到了这条消息
Get-PoshThemes : The term 'Get-PoshThemes' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ Get-PoshThemes
+ ~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-PoshThemes:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Run Code Online (Sandbox Code Playgroud)
谁能帮我?
Rob*_*pps 14
(Note: I'm running PowerShell 7.1 LTS)
[skip if you've already done so]
Instructions for installing a Nerd Font:
https://learn.microsoft.com/en-us/windows/terminal/tutorials/custom-prompt-setup#install-a-nerd-font
oh-my-posh
:1. 安装:posh-git
oh-my-posh
:
# This first step isn't included in the Microsoft Docs page:
Install-Module posh-git -Scope CurrentUser
# ...though this one is:
Install-Module oh-my-posh -Scope CurrentUser
Run Code Online (Sandbox Code Playgroud)
2. ...按照此处的其余说明进行操作:
3. ...最后,再次尝试该命令:
# Set the prompt theme (defaults to 'agnoster' for me)
# ! Note: You have to do this step first (or it still won't work)
Set-PoshPrompt
# List the available themes (should work now)
# ! Note: this will attempt to render a bunch of graphics in your shell
Get-PoshThemes
# ! Note: use the -List option to avoid a bunch of graphics in your shell
# This will list the paths to the themes (in plaintext):
Get-PoshThemes -List
Run Code Online (Sandbox Code Playgroud)
选修的
为了避免手动输入Set-PoshPrompt
,请在 PowerShell 中包含该命令$PROFILE
:
# ...e.g. to use the included 'zash' theme:
Set-PoshPrompt zash
Run Code Online (Sandbox Code Playgroud)
...当您打开启动 shell 实例(即新的 PowerShell 选项卡或窗口)时,您应该会看到 PowerShell 提示符发生变化。
在开始工作之前,我最初按照此处的说明进行操作:
https://learn.microsoft.com/en-us/windows/terminal/tutorials/custom-prompt-setup#install-a-nerd-font
...没有提及posh-git
模块或Set-PoshPrompt
命令(截至 2021 年 12 月 30 日)。
归档时间: |
|
查看次数: |
40813 次 |
最近记录: |