JanDeDobbeleer / oh-my-posh

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

Schema for Az segment is not reflecting "source" property at the right place #2055

Closed xadozuk closed 2 years ago

xadozuk commented 2 years ago

Code of Conduct

What happened?

When editing themes, using the schema validation, the "source" property for the Az segment is located at the segment root instead of the "properties" object.

Schema should indicate that "source" property inside the "properties" object.

Theme

Custom configuration:

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "blocks": [
    {
      "alignment": "left",
      "segments": [
        {
          "background": "green",
          "foreground": "#eeeeee",
          "properties": {
            "always_enabled": true,
            "style": "round"
          },
          "style": "diamond",
          "template": " {{ .FormattedMs }} ",
          "type": "executiontime"
        },
        {
          "background": "blue",
          "foreground": "#eeeeee",
          "powerline_symbol": "\ue0b0",
          "style": "powerline",
          "template": " \ufd03 {{ .Name }} {{ if eq .Origin \"PWSH\" }}\uf489{{ else }}\uf120{{ end }} ",
          "properties": {
            "source": "pwsh"
          },
          "type": "az"
        },
        {
          "background": "#c19c00",
          "foreground": "#eeeeee",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "parse_kubeconfig": true
          },
          "style": "powerline",
          "template": " \uf308 {{ .Context }}{{ if .Namespace }} :: {{ .Namespace }}{{ end }} ",
          "type": "kubectl"
        },
        {
          "background": "lightCyan",
          "foreground": "black",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "branch_icon": "\ue725 ",
            "branch_max_length": 0,
            "fetch_stash_count": false,
            "fetch_status": false,
            "fetch_upstream_icon": false
          },
          "style": "powerline",
          "template": " {{ .HEAD }} ",
          "type": "git"
        }
      ],
      "type": "prompt"
    },
    {
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "background": "transparent",
          "foreground": "darkGray",
          "properties": {
            "home_icon": "~",
            "style": "full"
          },
          "style": "plain",
          "template": "\uf07b {{ .Path }} ",
          "type": "path"
        }
      ],
      "type": "prompt"
    },
    {
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "foreground": "#eeeeee",
          "foreground_templates": [
            "{{ if gt .Code 0 }}red{{ end }}"
          ],
          "properties": {
            "always_enabled": false
          },
          "style": "diamond",
          "template": "\uf7d3 ",
          "type": "exit"
        },
        {
          "foreground": "#eeeeee",
          "style": "plain",
          "template": "\u276f",
          "type": "text"
        }
      ],
      "type": "prompt"
    }
  ],
  "final_space": true,
  "version": 2
}

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

I don't think it is necessary (as it is more linked to the schema file and not oh-my-posh execution).
I can always provide my output if required.
xadozuk commented 2 years ago

I will try to prepare a PR to solve this issue

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