今天,我在PowerShell中安装了Posh-Git,但这些图标并未显示出来,而是显示一个内部带有问号的矩形盒。以下是我遵循的步骤:
安装模块oh-my-posh -scope currentuser
然后
install module posh-git -scope currentuser
for二个软件包,我已经选择了是所有选项。
安装软件包后,我打开 microsoft.powershell_profile.ps1
文件,并添加了以下片段:
Import-Module oh-my-posh
Import-Module posh-git
Set-PoshPrompt -Theme M365Princess
# M365Princess is the theme name I found from oh-my-posh doc
在VS Code settings.json.json
中,我添加了此我添加了此“ terminal 。集成。fontfamily“:“ fira code”
。
仅供参考,我已经安装了 fira代码媒体中书呆子字体完整的Windows兼容
字体。
然后通过VS代码重新启动。颜色显示完美,有些图标,但有些却缺少如下屏幕截图中的示例。
请帮助我解决这个问题。
Today I installed posh-git in the PowerShell but the icons are not showing instead showing a rectangle box with a question mark inside. Below are the steps I followed to:
Install-Module oh-my-posh -Scope CurrentUser
then
Install-Module posh-git -Scope CurrentUser
For both packages, I have selected the Yes To All option.
After installing the packages, I opened Microsoft.PowerShell_profile.ps1
file and added the following snippet:
Import-Module oh-my-posh
Import-Module posh-git
Set-PoshPrompt -Theme M365Princess
# M365Princess is the theme name I found from oh-my-posh doc
After this in the VS Code settings.json
I added this "terminal.integrated.fontFamily": "Fira Code"
.
FYI, I have installed the Fira Code Medium Nerd Font Complete Windows Compatible
font already.
Then restarted by VS Code. Color is showing perfectly and also some icons but also some are missing like the example in the below screenshot.

Please help me out with how I can solve this.
发布评论
评论(4)
我遇到了同样的问题。这为我解决了。
安装OH-MY POSH推荐的书呆子字体
,一旦安装它们,就应该更改命令壳的属性。例如,我选择了Meslo字体。在Windows终端中,您可以更改设置。json并添加:
在PowerShell中,您转到
属性>字体
并选择一个书呆子字体之一。如果您需要再次充电配置文件,则可以使用
进行。 $ profile
。I was leading with the same problem. This solved it for me.
Install one of the nerd fonts recommended by oh-my-posh
Once that they are installed, you should change the properties of the command shell. For example, I selected Meslo font. In windows terminal, you change the settings.json and add:
In PowerShell, you go to
properties > fonts
and select one of nerd fonts.If you need to charge the profile again, you can do it with
. $PROFILE
.使用来自我的豪华的推荐字体
更多信息 https://ohmohmyposh.docs.docs/installation/fontals/fonts/fonts
i.sstatic.net/gjkie.png“ rel =” nofollow noreferrer“>哦,我的豪华字体
Use the recommended font from oh my posh
https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Meslo.zip
More info at https://ohmyposh.dev/docs/installation/fonts
oh my posh fonts
首先,两件事不再使用该模块,因为不再支持。更多信息在这里。其次,设置正确的字体,所以图标可以呈现,因为这就是为什么您会看到的原因
Two things, first, do not use the module anymore as that's no longer supported. More info here. Secondly, set the correct font so the icons can render, as that's why you see
您可以只需将书呆字体(安装任何书呆子字体)应用于
terminal.integrated.fontfamily
在vscode设置中注意:VSCODE建议使用Mono Font使用Mono Font
You can simply apply nerd font (After install any nerd font) to
terminal.integrated.fontFamily
in vscode settingsNote: Vscode recommends using Mono font