4

Windows ターミナルに oh-my-posh と posh-git をインストールしましたが、写真でわかるように、git の変更を追跡しません。私が行った変更に関係なく、ステータスなしで次のように表示されます。

ここに画像の説明を入力

oh-my-posh にはデフォルトでこの機能があると思っていたので、posh-git なしでも試してみましたが、結果は同じでした。

これが私のオーマイポッシュテーマです:

{
  "$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"
        },
        {
          "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
}

4

1 に答える 1

5

ここで答えを見つけました: https://ohmyposh.dev/docs/git/。どうやら git ステータスはデフォルトで無効になっているようです。そのため、プロパティ セクションを git 構成に追加する必要があります。

{
  "type": "git",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#193549",
  "background": "#ffeb3b",
  "properties": {
    "display_status": true,
    "display_stash_count": true,
    "display_upstream_icon": true
  }
}

posh-git を使用することもできます。

{
  "type": "poshgit",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#ffffff",
  "background": "#0077c2"
}
于 2021-07-02T16:04:49.437 に答える