JanDeDobbeleer / oh-my-posh

The most customisable and low-latency cross platform/shell prompt renderer
https://ohmyposh.dev
MIT License
17.02k stars 2.37k forks source link

Oh-my-posh not showing git status info. #1623

Closed mkartikk closed 2 years ago

mkartikk commented 2 years ago

Code of Conduct

What happened?

I recently installed oh-my-posh version 6.48 along with posh-git . However it only shows the git branch name . It doesnt modify the colors when the state of the repository is changed . I am using the paradox theme. I added this to the git configuration:

{
          "type": "git",
          "style": "powerline",
          "powerline_symbol": "\uE0B0",
          "foreground": "#193549",
          "background": "#95ffa4",
          "properties": {
            "template": "{{ .HEAD }}",
"display_status": true,
    "display_stash_count": true,
    "display_upstream_icon": true
          }
        }

Still the problem remains.

Theme

paradox

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

JanDeDobbeleer commented 2 years ago

Hey @mkartikk, you should update the git segment to reflect the latest changes and enable fetching the status information (disabled by default). As an example:

{
  "type": "git",
  "style": "powerline",
  "foreground": "#2a273f",
  "foreground_templates":
    ["{{ if and (gt .Ahead 0) (gt .Behind 0) }}#e0def4{{ end }}"],
  "background": "#3e8fb0",
  "background_templates":
    [
      "{{ if or (.Working.Changed) (.Staging.Changed) }}#f6c177{{ end }}",
      "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#a8216b{{ end }}",
      "{{ if gt .Ahead 0 }}#35b5ff{{ end }}",
      "{{ if gt .Behind 0 }}#f89cfa{{ end }}",
    ],
  "powerline_symbol": "",
  "properties":
    {
      "fetch_status": true,
      "fetch_upstream_icon": true,
      "branch_max_length": 25,
      "template": "[{{ .UpstreamIcon }} {{ .HEAD }}]({{ .UpstreamURL }}){{ .BranchStatus }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}",
    },
}
github-actions[bot] commented 7 months ago

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.