JanDeDobbeleer / oh-my-posh

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

Azure segment not showing subscription anymore #1543

Closed sdebruyn closed 2 years ago

sdebruyn commented 2 years ago

Code of Conduct

What happened?

Updated to latest version just now. The Azure segment used to show my subscription, but now it just says AzureCloud.

Theme

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "final_space": true,
  "console_title": true,
  "console_title_style": "template",
  "console_title_template": "{{ .Shell }} in {{ .Folder }}",
  "blocks": [
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "type": "path",
          "style": "diamond",
          "leading_diamond": "╭─",
          "trailing_diamond": "",
          "foreground": "#2d3436",
          "background": "#FF9248",
          "properties": {
            "enable_hyperlink": true,
            "prefix": " ",
            "style": "mixed",
            "home_icon": "\uf015",
            "folder_icon": "\uE5FF",
            "mapped_locations": {
              "~/projects": "\uf670"
            }
          }
        },
        {
          "type": "git",
          "style": "powerline",
          "powerline_symbol": "",
          "foreground": "#011627",
          "background": "#FFFB38",
          "background_templates": [
            "{{ if or (.Working.Changed) (.Staging.Changed) }}#ffeb95{{ end }}",
            "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#c5e478{{ end }}",
            "{{ if gt .Ahead 0 }}#C792EA{{ end }}",
            "{{ if gt .Behind 0 }}#C792EA{{ end }}"
          ],
          "properties": {
            "branch_icon": " ",
            "fetch_status": true,
            "fetch_upstream_icon": true,
            "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }}  {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}<#ef5350>  {{ .Staging.String }}</>{{ end }}"
          }
        },
        {
          "type": "executiontime",
          "style": "diamond",
          "leading_diamond": "",
          "trailing_diamond": "",
          "foreground": "#ffffff",
          "background": "#83769c",
          "properties": {
            "prefix": " 羽",
            "postfix": "⠀",
            "threshold": 0,
            "style": "roundrock"
          }
        }
      ]
    },
    {
      "type": "prompt",
      "alignment": "right",
      "segments": [
        {
          "type": "node",
          "style": "diamond",
          "leading_diamond": " ",
          "trailing_diamond": "",
          "foreground": "#3C873A",
          "background": "#303030",
          "properties": {
            "prefix": " ",
            "postfix": "",
            "display_package_manager": true,
            "yarn_icon": " <#348cba></>",
            "npm_icon": " <#cc3a3a></> "
          }
        },
        {
          "type": "python",
          "style": "diamond",
          "leading_diamond": " ",
          "trailing_diamond": "",
          "foreground": "#FFE873",
          "background": "#306998",
          "properties": {
            "prefix": " ",
            "postfix": ""
          }
        },
        {
          "type": "java",
          "style": "diamond",
          "leading_diamond": " ",
          "trailing_diamond": "",
          "foreground": "#ec2729",
          "background": "#0e8ac8",
          "properties": {
            "prefix": " ",
            "postfix": ""
          }
        },
        {
          "type": "dotnet",
          "style": "diamond",
          "leading_diamond": " ",
          "trailing_diamond": "",
          "foreground": "#0d6da8",
          "background": "#0e0e0e",
          "properties": {
            "prefix": " ",
            "postfix": ""
          }
        },
        {
          "type": "go",
          "style": "diamond",
          "leading_diamond": " ",
          "trailing_diamond": "",
          "foreground": "#06aad5",
          "background": "#ffffff",
          "properties": {
            "prefix": "ﳑ ",
            "postfix": ""
          }
        },
        {
          "type": "az",
          "style": "diamond",
          "leading_diamond": " ",
          "trailing_diamond": "",
          "foreground": "#FFFFFF",
          "background": "#2175B8",
          "properties": {
            "prefix": "\uFD03 ",
            "postfix": "<#262626> </>"
          }
        },
        {
          "type": "battery",
          "style": "diamond",
          "invert_powerline": true,
          "leading_diamond": "",
          "trailing_diamond": "",
          "foreground": "#262626",
          "background": "#f36943",
          "background_templates": [
            "{{if eq \"Charging\" .State.String}}#b8e994{{end}}",
            "{{if eq \"Discharging\" .State.String}}#fff34e{{end}}",
            "{{if eq \"Full\" .State.String}}#33DD2D{{end}}"
          ],
          "properties": {
            "discharging_icon": " ",
            "charging_icon": " ",
            "charged_icon": " ",
            "postfix": " <#262626></>"
          }
        },
        {
          "type": "time",
          "style": "diamond",
          "invert_powerline": true,
          "leading_diamond": "",
          "trailing_diamond": "",
          "background": "#40c4ff",
          "foreground": "#ffffff",
          "properties": {
            "prefix": "  ",
            "postfix": " ",
            "time_format": "15:04"
          }
        }
      ]
    },
    {
      "type": "prompt",
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "type": "text",
          "style": "plain",
          "foreground": "#21c7c7",
          "properties": {
            "prefix": "",
            "postfix": "",
            "text": "╰─"
          }
        },
        {
          "type": "exit",
          "style": "plain",
          "foreground": "#e0f8ff",
          "properties": {
            "prefix": "ff",
            "display_exit_code": false,
            "always_enabled": true,
            "error_color": "#ef5350"
          }
        }
      ]
    }
  ]
}

What OS are you seeing the problem on?

macOS

Which shell are you using?

zsh

Log output

╰─ff  oh-my-posh --debug --shell uni --config /Users/sam/.poshthemes/sam.omp.json

Version: 6.42.4

Segments:

ConsoleTitle(true)   -   0 ms - uni in ~
path(true)           -   0 ms - ╭─ 
git(false)           -   0 ms -
executiontime(true)  -   0 ms -  羽0ms⠀
node(false)          -   0 ms -
python(false)        -   0 ms -
java(false)          -   0 ms -
dotnet(false)        -   0 ms -
go(false)            -   0 ms -
az(true)             -   0 ms -  ﴃ AzureCloud 
battery(true)        -  20 ms -   99 
time(true)           -   0 ms -   14:19 
text(true)           -   0 ms - ╰─
exit(true)           -   0 ms - ff

Run duration: 23.547237ms

Logs:

2022/01/06 14:19:34 debug: getenv

2022/01/06 14:19:34 getenv duration: 12.258µs, args: XDG_CACHE_HOME
2022/01/06 14:19:34 getCachePath duration: 71.584µs, args:
2022/01/06 14:19:34 getArgs duration: 98ns, args:
2022/01/06 14:19:34 getArgs duration: 51ns, args:
2022/01/06 14:19:34 getShellName duration: 321ns, args:
2022/01/06 14:19:34 debug: getenv

2022/01/06 14:19:34 getenv duration: 2.581µs, args: OMP_CACHE_DISABLED
2022/01/06 14:19:34 isRunningAsRoot duration: 14.825µs, args:
2022/01/06 14:19:34 getcwd duration: 49.567µs, args:
2022/01/06 14:19:34 getPathSeperator duration: 94ns, args:
2022/01/06 14:19:34 getPathSeperator duration: 50ns, args:
2022/01/06 14:19:34 getShellName duration: 77ns, args:
2022/01/06 14:19:34 getCurrentUser duration: 307ns, args:
2022/01/06 14:19:34 getHostName duration: 10.664µs, args:
2022/01/06 14:19:34 getcwd duration: 122ns, args:
2022/01/06 14:19:34 getcwd duration: 71ns, args:
2022/01/06 14:19:34 getArgs duration: 78ns, args:
2022/01/06 14:19:34 getcwd duration: 52ns, args:
2022/01/06 14:19:34 getRuntimeGOOS duration: 68ns, args:
2022/01/06 14:19:34 getRuntimeGOOS duration: 52ns, args:
2022/01/06 14:19:34 getRuntimeGOOS duration: 52ns, args:
2022/01/06 14:19:34 getRuntimeGOOS duration: 53ns, args:
2022/01/06 14:19:34 getPathSeperator duration: 56ns, args:
2022/01/06 14:19:34 getPathSeperator duration: 51ns, args:
2022/01/06 14:19:34 getRuntimeGOOS duration: 78ns, args:
2022/01/06 14:19:34 debug: getenv

2022/01/06 14:19:34 getenv duration: 1.386µs, args: WSL_DISTRO_NAME
2022/01/06 14:19:34 isWsl duration: 3.664µs, args:
2022/01/06 14:19:34 stackCount duration: 116ns, args:
2022/01/06 14:19:34 getcwd duration: 159ns, args:
2022/01/06 14:19:34 debug: getenv

2022/01/06 14:19:34 getenv duration: 1.499µs, args: WSL_DISTRO_NAME
2022/01/06 14:19:34 isWsl duration: 4.154µs, args:
2022/01/06 14:19:34 getRuntimeGOOS duration: 72ns, args:
2022/01/06 14:19:34 hasCommand duration: 154.007µs, args: git
2022/01/06 14:19:34 getcwd duration: 97ns, args:
2022/01/06 14:19:34 error: hasParentFilePath
stat /.git: no such file or directory
2022/01/06 14:19:34 hasParentFilePath duration: 26.625µs, args: .git
2022/01/06 14:19:34 getcwd duration: 59ns, args:
2022/01/06 14:19:34 executionTime duration: 122ns, args:
2022/01/06 14:19:34 getcwd duration: 82ns, args:
2022/01/06 14:19:34 getcwd duration: 68ns, args:
2022/01/06 14:19:34 getcwd duration: 54ns, args:
2022/01/06 14:19:34 getcwd duration: 51ns, args:
2022/01/06 14:19:34 debug: getenv

2022/01/06 14:19:34 getenv duration: 1.304µs, args: VIRTUAL_ENV
2022/01/06 14:19:34 debug: getenv

2022/01/06 14:19:34 getenv duration: 989ns, args: CONDA_ENV_PATH
2022/01/06 14:19:34 debug: getenv

2022/01/06 14:19:34 getenv duration: 5.815µs, args: CONDA_DEFAULT_ENV
2022/01/06 14:19:34 debug: getenv

2022/01/06 14:19:34 getenv duration: 972ns, args: PYENV_VERSION
2022/01/06 14:19:34 debug: getenv
/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home
2022/01/06 14:19:34 getenv duration: 1.455µs, args: JAVA_HOME
2022/01/06 14:19:34 getcwd duration: 59ns, args:
2022/01/06 14:19:34 getcwd duration: 53ns, args:
2022/01/06 14:19:34 getcwd duration: 52ns, args:
2022/01/06 14:19:34 getcwd duration: 52ns, args:
2022/01/06 14:19:34 getcwd duration: 52ns, args:
2022/01/06 14:19:34 getcwd duration: 71ns, args:
2022/01/06 14:19:34 getcwd duration: 70ns, args:
2022/01/06 14:19:34 getFileContent duration: 66.733µs, args: /Users/sam/.azure/azureProfile.json
2022/01/06 14:19:34 getcwd duration: 133ns, args:
2022/01/06 14:19:34 getBatteryInfo duration: 20.458838ms, args:
2022/01/06 14:19:34 getcwd duration: 382ns, args:
2022/01/06 14:19:34 getcwd duration: 74ns, args:
2022/01/06 14:19:34 isRunningAsRoot duration: 998ns, args:
2022/01/06 14:19:34 getcwd duration: 49ns, args:
2022/01/06 14:19:34 getPathSeperator duration: 65ns, args:
2022/01/06 14:19:34 getPathSeperator duration: 67ns, args:
2022/01/06 14:19:34 getShellName duration: 429ns, args:
2022/01/06 14:19:34 getCurrentUser duration: 311ns, args:
2022/01/06 14:19:34 getHostName duration: 10.662µs, args:
2022/01/06 14:19:34 getcwd duration: 73ns, args:
2022/01/06 14:19:34 lastErrorCode duration: 325ns, args:
JanDeDobbeleer commented 2 years ago

The segment has been reworked to use the contents of the following file: /Users/sam/.azure/azureProfile.json. You can make use of the template to display what you want.

sdebruyn commented 2 years ago

But the default is the name, while it shows the environmentName for me?

JanDeDobbeleer commented 2 years ago

That's a bug as the code actually uses environment name as default.

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