安装POSH-GIT后,图标未显示在Powershell中

发布于 2025-02-13 21:46:28 字数 914 浏览 0 评论 0 原文

今天,我在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.

Posh Git

Please help me out with how I can solve this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

爱要勇敢去追 2025-02-20 21:46:28

我遇到了同样的问题。这为我解决了。

安装OH-MY POSH推荐的书呆子字体

oh-my-posh font install # Add --user if you're not running as administrator

,一旦安装它们,就应该更改命令壳的属性。例如,我选择了Meslo字体。在Windows终端中,您可以更改设置。json并添加:

{
    "profiles":
    {
        "defaults":
        {
            "font":
            {
                "face": "MesloLGM Nerd Font"
            }
        }
    }
}

在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

oh-my-posh font install # Add --user if you're not running as administrator

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:

{
    "profiles":
    {
        "defaults":
        {
            "font":
            {
                "face": "MesloLGM Nerd Font"
            }
        }
    }
}

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.

相对绾红妆 2025-02-20 21:46:28

使用来自我的豪华的推荐字体

更多信息 https://ohmohmyposh.docs.docs/installation/fontals/fonts/fonts

i.sstatic.net/gjkie.png“ rel =” nofollow noreferrer“>哦,我的豪华字体

何以笙箫默 2025-02-20 21:46:28

首先,两件事不再使用该模块,因为不再支持。更多信息在这里。其次,设置正确的字体,所以图标可以呈现,因为这就是为什么您会看到的原因

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

揪着可爱 2025-02-20 21:46:28

您可以只需将书呆字体(安装任何书呆子字体)应用于 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 settings

Note: Vscode recommends using Mono font

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文