首页 > 解决方案 > oh-my-posh 模块在 git 目录中运行缓慢

问题描述

我正在为 PowerShell 使用 oh-my-posh,它在 git repos 中非常慢。在常规目录中,如果我按 Enter 键,则会立即出现一个新行。但是,如果我在 git repos 中按 enter,则需要 1-2 秒才能出现新行。这是我的个人资料:

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "blocks": [
    {
      "alignment": "left",
      "segments": [
        {
          "background": "#91ddff",
          "foreground": "#100e23",
          "powerline_symbol": "",
          "properties": {
            "folder_icon": "",
            "folder_separator_icon": "  ",
            "home_icon": "",
            "style": "agnoster"
          },
          "style": "powerline",
          "type": "path"
        },
        {
          "background": "#95ffa4",
          "foreground": "#193549",
          "powerline_symbol": "",
          "style": "powerline",
          "type": "git",
          "properties": {
            "display_status": true,
            "display_stash_count": true,
            "display_upstream_icon": true
          }
        },
        {
          "background": "#906cff",
          "foreground": "#100e23",
          "powerline_symbol": "",
          "properties": {
            "prefix": "  "
          },
          "style": "powerline",
          "type": "python"
        },
        {
          "background": "#ff8080",
          "foreground": "#ffffff",
          "powerline_symbol": "",
          "style": "powerline",
          "type": "exit"
        }
      ],
      "type": "prompt"
    }
  ],
  "final_space": true
}

我也尝试过设置display_status,display_stash_countdisplay_upstream_iconfalse ,但这对性能几乎没有任何影响。有任何想法吗?

标签: gitoh-my-zsh

解决方案


推荐阅读