【问题标题】:Package Manager Console prompt is messed up after installing oh-my-posh安装 oh-my-posh 后,包管理器控制台提示混乱
【发布时间】:2023-02-23 02:42:56
【问题描述】:

我安装了 oh-my-posh 和 posh-git 并添加到我的 Powershell 配置文件中,如下所示

Import-Module posh-git
Import-Module oh-my-posh
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\thecyberden.omp.json" | Invoke-Expression

我在 Powershell 中使用 CaskaydiaCove NF 字体,我也将其设置为包管理器控制台的字体。

我的 Windows 终端提示是正确的:

但是,Visual Studio 中的包管理器控制台很奇怪,就像它无法找到正确的字形一样:

有没有办法修复我的程序包管理器控制台提示,以便它像 Powershell 一样正确显示,或者忽略 Powershell 配置文件并仅使用其默认提示?

【问题讨论】:

    标签: visual-studio visual-studio-2022 posh-git oh-my-posh


    【解决方案1】:

    这是因为该 shell 不支持 ANSI。如果是 7,请查看 PowerShell settings,否则无法修复。

    【讨论】:

      【解决方案2】:

      好的,自报告问题以来已经有一段时间了。我遇到了同样的问题并找到了解决方法。我像这样更改了我的 Profile.ps1:

      $vsprofile = "$env:VSAPPIDNAME"
      if (-not $vsprofile) {
        oh-my-posh init pwsh | Invoke-Expression
        Import-Module -Name Terminal-Icons  
      }
      

      这可能是一个丑陋的 hack,但通过 Windows 终端提供 oh-my-posh 并在 Visual Studio Package 中阻止它

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-05-09
        • 2023-03-18
        • 2012-09-09
        • 1970-01-01
        • 2021-09-27
        • 2015-12-23
        • 2022-01-16
        • 1970-01-01
        相关资源
        最近更新 更多