【问题标题】:Unrendered characters in oh-my-posh promptoh-my-posh 提示中未渲染的字符
【发布时间】:2021-05-09 12:52:47
【问题描述】:

我刚刚在 Windows 上的 PowerShell Core 7.1.1 上安装了 oh-my-posh,我正在 Windows 终端中使用 PowerShell。切换到git仓库后,提示如下: 一些字符显示为应该是三角形的框和分支字符,如 我目前正在使用 Cascadia 字体,我也尝试过 Meslo LG M Regular 和其他一些字体,但没有任何效果。我还将编码设置为 UTF-8,我可以在命令行中键入 Unicode 字符,它们会正确显示。现在我真的被困住了。

那么有人可以帮我解决这个问题吗?提前致谢。

【问题讨论】:

标签: git powershell powershell-core windows-terminal


【解决方案1】:

试试这个:

  • 如果您还没有,请将 oh-my-posh 更新到版本 3:Update-Module -Name oh-my-posh -Scope CurrentUser
  • https://www.nerdfonts.com/font-downloads下载并安装Caskaydia Cove Nerd Font字体
  • 在您的 PowerShell 配置文件 (Microsoft.PowerShell_profile.ps1) 中,设置一个像这样的主题:Set-Theme Powerline
  • 在 Windows 终端设置中,设置默认字体如下:
"profiles": {
        "defaults": {
            // Put settings here that you want to apply to all profiles.
            "fontFace": "CaskaydiaCove NF",
            "fontSize": 12
        },
}

【讨论】:

    猜你喜欢
    • 2023-02-23
    • 1970-01-01
    • 1970-01-01
    • 2021-10-09
    • 1970-01-01
    • 2023-03-18
    • 2023-02-24
    • 2015-06-20
    • 1970-01-01
    相关资源
    最近更新 更多