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 cannot be loaded #2744

Closed Wenxj1021 closed 2 years ago

Wenxj1021 commented 2 years ago

Code of Conduct

What happened?

In all versions after V32.8.4, oh-my-posh cannot be loaded correctly. The shell shows the error below.

Theme

Item2

What OS are you seeing the problem on?

Linux

Which shell are you using?

fish

Log output

Version: 8.37.1

Segments:

ConsoleTitle(true) -   0 ms - fish in ubuntu
session(true)  -   0 ms -   ubuntu 
path(true)     -   0 ms -   ~
git(false)     -   0 ms -
root(false)    -   0 ms -
exit(true)     -   0 ms -   
node(false)    -   0 ms -
go(false)      -   0 ms -
python(false)  -   0 ms -
shell(true)    -   0 ms - in fish
time(true)     -   0 ms - at 11:12:06

Run duration: 148.989414ms

Cache path: /home/ubuntu/.cache/oh-my-posh

Config path: /home/ubuntu/.cache/oh-my-posh/config.omp.json

Logs:

2022/09/03 11:12:06 debug: Getenv

2022/09/03 11:12:06 Getenv duration: 14.48µs, args: XDG_CACHE_HOME
2022/09/03 11:12:06 CachePath duration: 205.601µs, args:
2022/09/03 11:12:06 debug: Getenv

2022/09/03 11:12:06 Getenv duration: 2.48µs, args: POSH_THEME
2022/09/03 11:12:06 debug: Getenv

2022/09/03 11:12:06 Getenv duration: 920ns, args: XDG_CACHE_HOME
2022/09/03 11:12:06 CachePath duration: 7.8µs, args:
2022/09/03 11:12:06 debug: HTTPRequest
GET /JanDeDobbeleer/oh-my-posh/v8.37.1/themes/default.omp.json HTTP/1.1
Host: raw.githubusercontent.com
User-Agent: Go-http-client/1.1
Accept-Encoding: gzip

2022/09/03 11:12:06 debug: HTTPRequest
{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "blocks": [
    {
      "alignment": "left",
      "segments": [
        {
          "background": "p:yellow",
          "foreground": "p:black",
          "leading_diamond": "\ue0b6",
          "properties": {
            "display_host": false
          },
          "style": "diamond",
          "template": " {{ if .SSHSession }}\uf817 {{ end }}{{ .UserName }} ",
          "trailing_diamond": "\ue0b0",
          "type": "session"
        },
        {
          "background": "p:orange",
          "foreground": "p:white",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "home_icon": "~",
            "style": "folder"
          },
          "style": "powerline",
          "template": " \uf74a {{ path .Path .Location }} ",
          "type": "path"
        },
        {
          "background": "p:green",
          "background_templates": [
            "{{ if or (.Working.Changed) (.Staging.Changed) }}p:yellow{{ end }}",
            "{{ if and (gt .Ahead 0) (gt .Behind 0) }}p:red{{ end }}",
            "{{ if gt .Ahead 0 }}#49416D{{ end }}",
            "{{ if gt .Behind 0 }}#7A306C{{ end }}"
          ],
          "foreground": "p:black",
          "foreground_templates": [
            "{{ if or (.Working.Changed) (.Staging.Changed) }}p:black{{ end }}",
            "{{ if and (gt .Ahead 0) (gt .Behind 0) }}p:white{{ end }}",
            "{{ if gt .Ahead 0 }}p:white{{ end }}"
          ],
          "powerline_symbol": "\ue0b0",
          "properties": {
            "branch_max_length": 25,
            "fetch_status": true,
            "fetch_upstream_icon": true,
            "github_icon": "\uf7a3"
          },
          "style": "powerline",
          "template": " {{ if .UpstreamURL }}{{ url .UpstreamIcon .UpstreamURL }} {{ end }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }} ",
          "type": "git"
        },
        {
          "background": "p:yellow",
          "foreground": "p:white",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "root_icon": "\uf0ad"
          },
          "style": "powerline",
          "template": " \uf0e7 ",
          "type": "root"
        },
        {
          "background": "p:blue",
          "background_templates": [
            "{{ if gt .Code 0 }}p:red{{ end }}"
          ],
          "foreground": "p:white",
          "leading_diamond": "<transparent,background>\ue0b0</>",
          "properties": {
            "always_enabled": true
          },
          "style": "diamond",
          "template": " {{ if gt .Code 0 }}\uf00d{{ else }}\uf00c{{ end }} ",
          "trailing_diamond": "\ue0b4",
          "type": "exit"
        }
      ],
      "type": "prompt"
    },
    {
      "segments": [
        {
          "background": "transparent",
          "foreground": "p:green",
          "properties": {
            "display_mode": "files",
            "fetch_package_manager": false,
            "home_enabled": false
          },
          "style": "plain",
          "template": "\uf898 ",
          "type": "node"
        },
        {
          "background": "transparent",
          "foreground": "p:blue",
          "properties": {
            "fetch_version": false
          },
          "style": "powerline",
          "template": "\ufcd1 ",
          "type": "go"
        },
        {
          "background": "transparent",
          "foreground": "p:yellow",
          "properties": {
            "display_mode": "files",
            "fetch_version": true,
            "fetch_virtual_env": false
          },
          "style": "plain",
          "template": "\ue235 ",
          "type": "python"
        },
        {
          "background": "transparent",
          "foreground": "p:white",
          "style": "plain",
          "template": "in <p:blue><b>{{ .Name }}</b></> ",
          "type": "shell"
        },
        {
          "background": "transparent",
          "foreground": "p:white",
          "style": "plain",
          "template": "at <p:blue><b>{{ .CurrentDate | date \"15:04:05\" }}</b></>",
          "type": "time"
        }
      ],
      "type": "rprompt"
    }
  ],
  "console_title_template": "{{ .Shell }} in {{ .Folder }}",
  "final_space": true,
  "palette": {
    "black": "#262B44",
    "blue": "#4B95E9",
    "green": "#59C9A5",
    "orange": "#F07623",
    "red": "#D81E5B",
    "white": "#E0DEF4",
    "yellow": "#F3AE35"
  },
  "secondary_prompt": {
    "background": "transparent",
    "foreground": "p:black",
    "template": "<p:yellow,transparent>\ue0b6</><,p:yellow> > </><p:yellow,transparent>\ue0b0</> "
  },
  "tooltips": [
    {
      "background": "p:orange",
      "foreground": "p:white",
      "leading_diamond": "\ue0b6",
      "properties": {
        "display_default": true
      },
      "style": "diamond",
      "template": " \ue7ad {{ .Profile }}{{ if .Region }}@{{ .Region }}{{ end }} ",
      "tips": [
        "aws"
      ],
      "trailing_diamond": "\ue0b4",
      "type": "aws"
    },
    {
      "background": "p:blue",
      "foreground": "p:white",
      "leading_diamond": "\ue0b6",
      "style": "diamond",
      "template": " \ufd03 {{ .Name }} ",
      "tips": [
        "az"
      ],
      "trailing_diamond": "\ue0b4",
      "type": "az"
    }
  ],
  "transient_prompt": {
    "background": "transparent",
    "foreground": "p:black",
    "template": "<p:yellow,transparent>\ue0b6</><,p:yellow> {{ .Folder }} </><p:yellow,transparent>\ue0b0</> "
  },
  "version": 2
}

2022/09/03 11:12:06 HTTPRequest duration: 140.224951ms, args: https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/v8.37.1/themes/default.omp.json
2022/09/03 11:12:06 downloadConfig duration: 143.243839ms, args: https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/v8.37.1/themes/default.omp.json
2022/09/03 11:12:06 resolveConfigPath duration: 143.270559ms, args:
2022/09/03 11:12:06 Init duration: 143.85712ms, args:
2022/09/03 11:12:06 Flags duration: 80ns, args:
2022/09/03 11:12:06 config.loadConfig duration: 1.746165ms, args:
2022/09/03 11:12:06 Flags duration: 40ns, args:
2022/09/03 11:12:06 debug: Getenv

2022/09/03 11:12:06 Getenv duration: 2.6µs, args: OMP_CACHE_DISABLED
2022/09/03 11:12:06 Root duration: 1.16µs, args:
2022/09/03 11:12:06 Shell duration: 550.802µs, args:
2022/09/03 11:12:06 ErrorCode duration: 40ns, args:
2022/09/03 11:12:06 debug: Getenv

2022/09/03 11:12:06 Getenv duration: 1.56µs, args: WSL_DISTRO_NAME
2022/09/03 11:12:06 IsWsl duration: 4.16µs, args:
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 14.44µs, args:
2022/09/03 11:12:06 GOOS duration: 40ns, args:
2022/09/03 11:12:06 GOOS duration: 40ns, args:
2022/09/03 11:12:06 GOOS duration: 40ns, args:
2022/09/03 11:12:06 GOOS duration: 80ns, args:
2022/09/03 11:12:06 GOOS duration: 40ns, args:
2022/09/03 11:12:06 GOOS duration: 40ns, args:
2022/09/03 11:12:06 GOOS duration: 40ns, args:
2022/09/03 11:12:06 debug: User
ubuntu
2022/09/03 11:12:06 User duration: 1.04µs, args:
2022/09/03 11:12:06 debug: Host
wenxuejin-ddns-net
2022/09/03 11:12:06 Host duration: 2.92µs, args:
2022/09/03 11:12:06 GOOS duration: 80ns, args:
2022/09/03 11:12:06 TemplateCache duration: 609.482µs, args:
2022/09/03 11:12:06 Flags duration: 80ns, args:
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 1.2µs, args:
2022/09/03 11:12:06 GOOS duration: 40ns, args:
2022/09/03 11:12:06 debug: Getenv
2601:280:5a00:37d:24f1:bd32:3541:9afe 3921 2603:c024:c004:87e:7834:d2dc:f418:27ee 22
2022/09/03 11:12:06 Getenv duration: 2.12µs, args: SSH_CONNECTION
2022/09/03 11:12:06 TemplateCache duration: 80ns, args:
2022/09/03 11:12:06 TemplateCache duration: 240ns, args:
2022/09/03 11:12:06 Shell duration: 200ns, args:
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 1.72µs, args:
2022/09/03 11:12:06 GOOS duration: 80ns, args:
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 840ns, args:
2022/09/03 11:12:06 Flags duration: 40ns, args:
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 800ns, args:
2022/09/03 11:12:06 GOOS duration: 80ns, args:
2022/09/03 11:12:06 GOOS duration: 40ns, args:
2022/09/03 11:12:06 GOOS duration: 40ns, args:
2022/09/03 11:12:06 GOOS duration: 40ns, args:
2022/09/03 11:12:06 PathSeparator duration: 40ns, args:
2022/09/03 11:12:06 PathSeparator duration: 40ns, args:
2022/09/03 11:12:06 GOOS duration: 40ns, args:
2022/09/03 11:12:06 debug: Getenv

2022/09/03 11:12:06 Getenv duration: 1.16µs, args: WSL_DISTRO_NAME
2022/09/03 11:12:06 IsWsl duration: 6.36µs, args:
2022/09/03 11:12:06 StackCount duration: 40ns, args:
2022/09/03 11:12:06 DirIsWritable duration: 9.56µs, args:
2022/09/03 11:12:06 TemplateCache duration: 40ns, args:
2022/09/03 11:12:06 TemplateCache duration: 160ns, args:
2022/09/03 11:12:06 Shell duration: 120ns, args:
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 1.4µs, args:
2022/09/03 11:12:06 GOOS duration: 80ns, args:
2022/09/03 11:12:06 debug: Getenv

2022/09/03 11:12:06 Getenv duration: 960ns, args: WSL_DISTRO_NAME
2022/09/03 11:12:06 IsWsl duration: 2.92µs, args:
2022/09/03 11:12:06 GOOS duration: 40ns, args:
2022/09/03 11:12:06 debug: CommandPath
/usr/bin/git
2022/09/03 11:12:06 CommandPath duration: 16.8µs, args: git
2022/09/03 11:12:06 HasCommand duration: 22.96µs, args: git
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 960ns, args:
2022/09/03 11:12:06 error: HasParentFilePath
stat /.git: no such file or directory
2022/09/03 11:12:06 HasParentFilePath duration: 10.6µs, args: .git
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 920ns, args:
2022/09/03 11:12:06 GOOS duration: 40ns, args:
2022/09/03 11:12:06 Root duration: 360ns, args:
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 880ns, args:
2022/09/03 11:12:06 GOOS duration: 40ns, args:
2022/09/03 11:12:06 ErrorCode duration: 80ns, args:
2022/09/03 11:12:06 TemplateCache duration: 40ns, args:
2022/09/03 11:12:06 TemplateCache duration: 120ns, args:
2022/09/03 11:12:06 Shell duration: 120ns, args:
2022/09/03 11:12:06 TemplateCache duration: 80ns, args:
2022/09/03 11:12:06 Flags duration: 80ns, args:
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 3.2µs, args:
2022/09/03 11:12:06 GOOS duration: 80ns, args:
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 960ns, args:
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 1.32µs, args:
2022/09/03 11:12:06 GOOS duration: 40ns, args:
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 880ns, args:
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 1.64µs, args:
2022/09/03 11:12:06 GOOS duration: 40ns, args:
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 1.04µs, args:
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 881ns, args:
2022/09/03 11:12:06 PathSeparator duration: 40ns, args:
2022/09/03 11:12:06 debug: HasFiles
false
2022/09/03 11:12:06 HasFiles duration: 65.441µs, args: *.py
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 880ns, args:
2022/09/03 11:12:06 PathSeparator duration: 40ns, args:
2022/09/03 11:12:06 debug: HasFiles
false
2022/09/03 11:12:06 HasFiles duration: 36.4µs, args: *.ipynb
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 920ns, args:
2022/09/03 11:12:06 PathSeparator duration: 80ns, args:
2022/09/03 11:12:06 debug: HasFiles
false
2022/09/03 11:12:06 HasFiles duration: 6.44µs, args: pyproject.toml
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 1.64µs, args:
2022/09/03 11:12:06 PathSeparator duration: 40ns, args:
2022/09/03 11:12:06 debug: HasFiles
false
2022/09/03 11:12:06 HasFiles duration: 7.28µs, args: venv.bak
2022/09/03 11:12:06 debug: HasFolder
false
2022/09/03 11:12:06 HasFolder duration: 2.68µs, args: .venv
2022/09/03 11:12:06 debug: HasFolder
false
2022/09/03 11:12:06 HasFolder duration: 2.16µs, args: venv
2022/09/03 11:12:06 debug: HasFolder
false
2022/09/03 11:12:06 HasFolder duration: 2.2µs, args: virtualenv
2022/09/03 11:12:06 debug: HasFolder
false
2022/09/03 11:12:06 HasFolder duration: 2.04µs, args: env
2022/09/03 11:12:06 debug: HasFolder
false
2022/09/03 11:12:06 HasFolder duration: 2.28µs, args: venv-win
2022/09/03 11:12:06 debug: HasFolder
false
2022/09/03 11:12:06 HasFolder duration: 2.28µs, args: pyenv-win
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 1.28µs, args:
2022/09/03 11:12:06 GOOS duration: 80ns, args:
2022/09/03 11:12:06 Shell duration: 120ns, args:
2022/09/03 11:12:06 Flags duration: 40ns, args:
2022/09/03 11:12:06 TemplateCache duration: 80ns, args:
2022/09/03 11:12:06 TemplateCache duration: 160ns, args:
2022/09/03 11:12:06 Shell duration: 80ns, args:
2022/09/03 11:12:06 debug: Pwd
/home/ubuntu
2022/09/03 11:12:06 Pwd duration: 1.32µs, args:
2022/09/03 11:12:06 GOOS duration: 40ns, args:
2022/09/03 11:12:06 TemplateCache duration: 80ns, args:
2022/09/03 11:12:06 TemplateCache duration: 120ns, args:
2022/09/03 11:12:06 Shell duration: 80ns, args:
2022/09/03 11:12:06 debug: Getenv

2022/09/03 11:12:06 Getenv duration: 1.44µs, args: XDG_CACHE_HOME
2022/09/03 11:12:06 CachePath duration: 14.8µs, args:
2022/09/03 11:12:06 Flags duration: 40ns, args:
JanDeDobbeleer commented 2 years ago

@Wenxj1021 you need to update fish 😉

Wenxj1021 commented 2 years ago

That works. Thank you!

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.