JanDeDobbeleer / oh-my-posh

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

GitLab upstream not detected #1285

Closed Leccho closed 2 years ago

Leccho commented 2 years ago

Code of Conduct

What happened?

When using GitLab upstream, the icon for the upstream that is not known or mapped appear. How does oh-my-posh detect the GitLab upstream?

Theme

I've created my own theme:

{
  "final_space": true,
  "console_title": true,
  "console_title_style": "folder",
  "blocks": [
    {
      "type": "prompt",
      "alignment": "left",
      "horizontal_offset": 0,
      "vertical_offset": 0,
      "segments": [
        {
          "type": "os",
          "style": "diamond",
          "foreground": "#ffffff",
          "background": "#333333",
          "trailing_diamond": "",
          "properties": null
        },
        {
          "type": "session",
          "style": "diamond",
          "powerline_symbol": "",
          "invert_powerline": false,
          "foreground": "#ffffff",
          "background": "#333333",
          "leading_diamond": "",
          "trailing_diamond": "",
          "properties": null
        },
        {
          "type": "path",
          "style": "powerline",
          "powerline_symbol": "",
          "invert_powerline": false,
          "foreground": "#ffffff",
          "background": "#2569b4",
          "leading_diamond": "",
          "trailing_diamond": "",
          "properties": {
            "folder_separator_icon": " <#011627>\uE0B1</> ",
            "home_icon": "\uf7db ",
            "folder_icon": "\uf07c ",
            "style": "agnoster",
            "enable_hyperlink": true
          }
        },
        {
          "type": "git",
          "style": "powerline",
          "powerline_symbol": "",
          "invert_powerline": false,
          "foreground": "#ffffff",
          "background": "#6ca35e",
          "leading_diamond": "",
          "trailing_diamond": "",
          "properties": {
            "display_status": true,
            "display_stash_count": true,
            "display_upstream_icon": true,
            "status_colors_enabled": true,
            "color_background": true,
            "local_changes_color": "#fbc02d",
            "ahead_and_behind_color": "#fbc02d",
            "behind_color": "#f17c37",
            "ahead_color": "#9c27b0",
            "git_icon": "\uf7a1 "
          }
        },
        {
          "type": "root",
          "style": "powerline",
          "powerline_symbol": "",
          "invert_powerline": false,
          "foreground": "#ffffff",
          "background": "#b71c1c",
          "leading_diamond": "",
          "trailing_diamond": "",
          "properties": null
        }
      ]
    },
    {
      "type": "prompt",
      "alignment": "left",
      "newline": true,
      "horizontal_offset": 0,
      "vertical_offset": 0,
      "segments": [
        {
          "type": "text",
          "style": "plain",
          "properties": {
            "prefix": "",
            "text": " \u276F"
          }
        }
      ]
    }
  ]
}

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

Using the command above (Write-PoshDebug):

Here are the timings of segments in your prompt:

ConsoleTitle(true) -   0 ms -
os(true)       -   0 ms -  
session(true)  -   0 ms -  user@pc 
path(true)     -   0 ms -              project 
git(true)      -  52 ms -   branch ≡  ~1 
root(false)    -   0 ms -
text(true)     -   0 ms -  ❯
JanDeDobbeleer commented 2 years ago

@Leccho can you pls update to the latest version and try again?

Leccho commented 2 years ago

I just upgraded to version 6.11.1 and I still get the same thing. I also tried deleting the whole thing and then reinstalling just to be sure.

Leccho commented 2 years ago

Ok, I get the problem... I use gitlab.mydomain.com... Is there a way to map it localy?

lnu commented 2 years ago

The logic is a bit naive but works well for non personal domain scenario: https://github.com/JanDeDobbeleer/oh-my-posh/blob/ea35416363a38ad9e866133a65731908bdbcb9f4/src/segment_git.go#L251

But your case should work since the url check is contains « gitlab »

Leccho commented 2 years ago

Yes, it's working now thanks.

github-actions[bot] commented 6 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.