JanDeDobbeleer / oh-my-posh

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

Cannot load `oh-my-posh` when terminal restarts on zsh & bash #5829

Closed GinoongFlores closed 2 weeks ago

GinoongFlores commented 2 weeks ago

Code of Conduct

What happened?

Idk, if this is a bug or am I missing something. Correct me I'm wrong. Btw, oh-my-posh is superb!

Quite newbie on working with shells. I have this issue lately on my linux Fedora using zsh. Where the zsh or bash cannot load the oh-my-posh from my /home/username/.local/bin/oh-my-posh. Even though, I already added the eval "$(oh-my-posh init zsh)" on my .zshrc. It error says zsh: oh-my-posh: command not found...

I can find a workaround where I needed to go to bash first then zsh. Then, the oh-my-posh will started to display.

Thanks in advance for some insights!

Theme

I'm using kitty as my terminal and its catpuccino theme

What OS are you seeing the problem on?

Linux

Which shell are you using?

No response

Log output

ersion: 24.0.8

Shell: zsh (5.9)

Prompt:

 ginoongflores   %{%}~%{%}    

Segments:

ConsoleTitle(true)                        -   0 ms
Session(true)                             -   0 ms
Path(true)                                -   0 ms
Git(false)                                -   0 ms
Root(false)                               -   0 ms
Status(true)                              -   0 ms
Node(false)                               -   0 ms
Go(false)                                 -   0 ms
Python(false)                             -   0 ms
Shell(true)                               -   0 ms
Time(true)                                -   0 ms

Run duration: 2.609575ms

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

Config path: no --config set, using default built-in configuration

Logs:

[DEBUG] 16:43:42.432 debug.go:49 → debug mode enabled
[DEBUG] 16:43:42.432 debug.go:49 → plain mode enabled
[DEBUG] 16:43:42.432 terminal.go:Getenv:161 → NO DATA
[TRACE] 16:43:42.432 terminal.go:Getenv(LOCALAPPDATA) - 11.814µs
[DEBUG] 16:43:42.432 terminal.go:Getenv:161 → NO DATA
[TRACE] 16:43:42.432 terminal.go:Getenv(OMP_CACHE_DIR) - 1.873µs
[DEBUG] 16:43:42.432 terminal.go:Getenv:161 → NO DATA
[TRACE] 16:43:42.432 terminal.go:Getenv(XDG_CACHE_HOME) - 1.751µs
[TRACE] 16:43:42.432 terminal.go:CachePath() - 36.541µs
[DEBUG] 16:43:42.432 terminal.go:65 → loading cache file: /home/ginoongflores/.cache/oh-my-posh/omp.cache
[DEBUG] 16:43:42.432 terminal.go:65 → loading cache key: environment_platform
[DEBUG] 16:43:42.432 terminal.go:65 → loading cache key: is_wsl
[TRACE] 16:43:42.432 terminal.go(/home/ginoongflores/.cache/oh-my-posh/omp.cache) - 122.155µs
[DEBUG] 16:43:42.432 terminal.go:Getenv:161 → NO DATA
[TRACE] 16:43:42.432 terminal.go:Getenv(LOCALAPPDATA) - 1.88µs
[DEBUG] 16:43:42.432 terminal.go:Getenv:161 → NO DATA
[TRACE] 16:43:42.432 terminal.go:Getenv(OMP_CACHE_DIR) - 1.635µs
[DEBUG] 16:43:42.432 terminal.go:Getenv:161 → NO DATA
[TRACE] 16:43:42.432 terminal.go:Getenv(XDG_CACHE_HOME) - 1.687µs
[TRACE] 16:43:42.432 terminal.go:CachePath() - 16.351µs
[DEBUG] 16:43:42.432 terminal.go:65 → loading cache file: /home/ginoongflores/.cache/oh-my-posh/omp.cache.2dfbcbba-7cb0-4bb7-8811-08a3d18a8b02
[DEBUG] 16:43:42.432 terminal.go:65 → loading cache key: prompt_count_cache
[DEBUG] 16:43:42.432 terminal.go:65 → loading cache key: template_cache
[TRACE] 16:43:42.432 terminal.go(/home/ginoongflores/.cache/oh-my-posh/omp.cache.2dfbcbba-7cb0-4bb7-8811-08a3d18a8b02) - 33.622µs
[TRACE] 16:43:42.432 terminal.go:setPromptCount() - 373ns
[TRACE] 16:43:42.432 terminal.go:GOOS() - 44ns
[DEBUG] 16:43:42.432 terminal.go:setPwd:194 → /home/ginoongflores
[TRACE] 16:43:42.432 terminal.go:setPwd() - 7.726µs
[DEBUG] 16:43:42.432 terminal.go:Getenv:161 → NO DATA
[TRACE] 16:43:42.432 terminal.go:Getenv(POSH_THEME) - 5.211µs
[DEBUG] 16:43:42.432 terminal.go:ResolveConfigPath:99 → no config set, fallback to default config
[TRACE] 16:43:42.432 terminal.go:ResolveConfigPath() - 10.134µs
[TRACE] 16:43:42.432 terminal.go:Init() - 301.321µs
[TRACE] 16:43:42.432 terminal.go:Shell() - 171ns
[TRACE] 16:43:42.432 terminal.go:Flags() - 39ns
[DEBUG] 16:43:42.432 load.go:loadConfig:55 → no config file specified, using default
[TRACE] 16:43:42.432 load.go:loadConfig() - 21.359µs
[TRACE] 16:43:42.432 terminal.go:Flags() - 23ns
[DEBUG] 16:43:42.432 debug.go:59 → terminal program: Unknown
[DEBUG] 16:43:42.432 debug.go:59 → terminal shell: zsh
[DEBUG] 16:43:42.432 terminal.go:Getenv:161 → NO DATA
[TRACE] 16:43:42.432 terminal.go:Getenv(OMP_CACHE_DISABLED) - 1.806µs
[TRACE] 16:43:42.432 colors.go:SetAccentColor() - 725ns
[TRACE] 16:43:42.432 terminal.go:Shell() - 29ns
[DEBUG] 16:43:42.432 terminal.go:Getenv:161 → 5.9
[TRACE] 16:43:42.432 terminal.go:Getenv(POSH_SHELL_VERSION) - 2.024µs
[DEBUG] 16:43:42.432 debug.go:PrintDebug:23 → segment: Title
[TRACE] 16:43:42.433 terminal_unix.go:Root() - 313ns
[TRACE] 16:43:42.433 terminal.go:Shell() - 29ns
[TRACE] 16:43:42.433 terminal.go:StatusCodes() - 54ns
[DEBUG] 16:43:42.433 terminal_unix.go:IsWsl:35 → false
[TRACE] 16:43:42.433 terminal_unix.go:IsWsl() - 6.067µs
[DEBUG] 16:43:42.433 terminal_unix.go:IsWsl:35 → false
[TRACE] 16:43:42.433 terminal_unix.go:IsWsl() - 2.202µs
[TRACE] 16:43:42.433 terminal.go:GOOS() - 23ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 20ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 19ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 20ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 36ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 21ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 21ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 21ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 36ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 23ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 20ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 20ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 19ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 36ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 21ns
[DEBUG] 16:43:42.433 terminal.go:User:331 → ginoongflores
[TRACE] 16:43:42.433 terminal.go:User() - 2.423µs
[DEBUG] 16:43:42.433 terminal.go:Host:348 → fedora
[TRACE] 16:43:42.433 terminal.go:Host() - 2.854µs
[TRACE] 16:43:42.433 terminal.go:GOOS() - 21ns
[DEBUG] 16:43:42.433 terminal_unix.go:Platform:95 → fedora
[DEBUG] 16:43:42.433 terminal.go:Getenv:161 → 3
[TRACE] 16:43:42.433 terminal.go:Getenv(SHLVL) - 2.121µs
[TRACE] 16:43:42.433 terminal.go:TemplateCache() - 76.509µs
[TRACE] 16:43:42.433 text.go:Render({{ .Shell }} in {{ .Folder }}) - 278.065µs
[TRACE] 16:43:42.433 terminal.go:Flags() - 36ns
[DEBUG] 16:43:42.433 terminal.go:Getenv:161 → NO DATA
[TRACE] 16:43:42.433 terminal.go:Getenv(POSH_CURSOR_LINE) - 1.865µs
[DEBUG] 16:43:42.433 terminal.go:Getenv:161 → NO DATA
[TRACE] 16:43:42.433 terminal.go:Getenv(POSH_CURSOR_COLUMN) - 4.043µs
[TRACE] 16:43:42.433 terminal.go:Flags() - 22ns
[TRACE] 16:43:42.433 terminal.go:Flags() - 20ns
[TRACE] 16:43:42.433 terminal.go:Flags() - 238ns
[TRACE] 16:43:42.433 terminal.go:Flags() - 31ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 72ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 51ns
[DEBUG] 16:43:42.433 segment.go:Execute:108 → segment: Status
[DEBUG] 16:43:42.433 segment.go:Execute:108 → segment: Session
[DEBUG] 16:43:42.433 terminal.go:Getenv:161 → NO DATA
[TRACE] 16:43:42.433 terminal.go:StatusCodes() - 51ns
[TRACE] 16:43:42.433 terminal.go:Getenv(SSH_CONNECTION) - 6.191µs
[DEBUG] 16:43:42.433 terminal.go:Getenv:161 → NO DATA
[TRACE] 16:43:42.433 terminal.go:Getenv(SSH_CLIENT) - 1.735µs
[TRACE] 16:43:42.433 terminal.go:Flags() - 178ns
[DEBUG] 16:43:42.433 terminal_unix.go:Platform:95 → fedora
[DEBUG] 16:43:42.433 status.go:formatStatus:45 → {{ .Code }}
[TRACE] 16:43:42.433 terminal.go:GOOS() - 105ns
[DEBUG] 16:43:42.433 segment.go:Execute:108 → segment: Path
[DEBUG] 16:43:42.433 path.go:145 → display_cygpath: false
[TRACE] 16:43:42.433 text.go:Render({{ .Code }}) - 24.889µs
[TRACE] 16:43:42.433 terminal.go:GOOS() - 39ns
[DEBUG] 16:43:42.433 status.go:Enabled:37 → always_enabled: true
[TRACE] 16:43:42.433 terminal.go:GOOS() - 21ns
[TRACE] 16:43:42.433 terminal.go:PathSeparator() - 1.965µs
[TRACE] 16:43:42.433 terminal.go:TemplateCache() - 78ns
[TRACE] 16:43:42.433 terminal.go:Shell() - 77ns
[TRACE] 16:43:42.433 terminal.go:Flags() - 182ns
[TRACE] 16:43:42.433 terminal.go:Shell() - 37ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 37ns
[TRACE] 16:43:42.433 terminal.go:Flags() - 22ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 37ns
[DEBUG] 16:43:42.433 segment.go:Execute:108 → segment: Root
[DEBUG] 16:43:42.433 path.go:setMappedLocations:552 → mapped_locations_enabled: true
[DEBUG] 16:43:42.433 path.go:setMappedLocations:553 → 
[TRACE] 16:43:42.433 terminal.go:GOOS() - 113ns
[DEBUG] 16:43:42.433 path.go:setMappedLocations:554 → 
[DEBUG] 16:43:42.433 segment.go:Execute:108 → segment: Git
[DEBUG] 16:43:42.433 terminal_unix.go:IsWsl:35 → false
[TRACE] 16:43:42.433 terminal.go:GOOS() - 42ns
[TRACE] 16:43:42.433 terminal.go:PathSeparator() - 20.344µs
[TRACE] 16:43:42.433 terminal_unix.go:IsWsl() - 5.026µs
[TRACE] 16:43:42.433 terminal.go:GOOS() - 38ns
[TRACE] 16:43:42.433 terminal_unix.go:IsWsl2() - 8.015µs
[TRACE] 16:43:42.433 terminal.go:GOOS() - 24ns
[DEBUG] 16:43:42.433 terminal.go:CommandPath:395 → /usr/bin/git
[TRACE] 16:43:42.433 terminal.go:GOOS() - 27ns
[TRACE] 16:43:42.433 terminal.go:CommandPath(git) - 29.945µs
[TRACE] 16:43:42.433 terminal.go:GOOS() - 38ns
[TRACE] 16:43:42.433 terminal.go:HasCommand(git) - 32.949µs
[DEBUG] 16:43:42.433 path.go:setMappedLocations:555 → ~
[DEBUG] 16:43:42.433 git.go:shouldDisplay:326 → fetch_bare_info: false
[DEBUG] 16:43:42.433 path.go:setMappedLocations:560 → mapped_locations: map[]
[DEBUG] 16:43:42.433 terminal.go:ResolveSymlink:287 → /home/ginoongflores
[TRACE] 16:43:42.433 terminal.go:GOOS() - 20ns
[TRACE] 16:43:42.433 terminal.go:ResolveSymlink(/home/ginoongflores) - 6.477µs
[TRACE] 16:43:42.433 terminal.go:PathSeparator() - 2.632µs
[TRACE] 16:43:42.433 terminal.go:GOOS() - 29ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 29ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 30ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 32ns
[ERROR] 16:43:42.433 terminal.go:HasParentFilePath:559 → stat .git: no such file or directory
[TRACE] 16:43:42.433 terminal.go:PathSeparator() - 2.488µs
[TRACE] 16:43:42.433 terminal.go:HasParentFilePath(.git) - 25.046µs
[TRACE] 16:43:42.433 terminal.go:GOOS() - 23ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 59ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 39ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 28ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 32ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 48ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 22ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 32ns
[TRACE] 16:43:42.433 terminal.go:Flags() - 62ns
[DEBUG] 16:43:42.433 path.go:colorizePath:728 → cycle: []
[DEBUG] 16:43:42.433 path.go:getFolderSeparator:263 → NO DATA
[DEBUG] 16:43:42.433 path.go:getFolderSeparator:265 → /
[DEBUG] 16:43:42.433 path.go:colorizePath:731 → cycle_folder_separator: false
[DEBUG] 16:43:42.433 path.go:colorizePath:732 → %s
[DEBUG] 16:43:42.433 path.go:colorizePath:734 → %s
[DEBUG] 16:43:42.433 path.go:colorizePath:735 → %s
[DEBUG] 16:43:42.433 path.go:colorizePath:736 → %s
[TRACE] 16:43:42.433 terminal.go:TemplateCache() - 105ns
[TRACE] 16:43:42.433 terminal.go:GOOS() - 47ns
[TRACE] 16:43:42.433 terminal.go:StackCount() - 80ns
[TRACE] 16:43:42.433 terminal_unix.go:DirIsWritable(/home/ginoongflores) - 5.248µs
[TRACE] 16:43:42.433 terminal.go:TemplateCache() - 57ns
[DEBUG] 16:43:42.434 terminal.go:RunCommand:371 → NO DATA
[TRACE] 16:43:42.434 terminal.go:RunCommand(who am i) - 758.216µs
[TRACE] 16:43:42.434 terminal.go:TemplateCache() - 66ns
[TRACE] 16:43:42.434 terminal.go:TemplateCache() - 130ns
[TRACE] 16:43:42.434 text.go:Render( {{ if .SSHSession }} {{ end }}{{ .UserName }} ) - 492.125µs
[TRACE] 16:43:42.434 text.go:Render(diamond) - 121ns
[TRACE] 16:43:42.434 text.go:Render(  {{ path .Path .Location }} ) - 27.851µs
[TRACE] 16:43:42.434 text.go:Render(powerline) - 133ns
[TRACE] 16:43:42.434 text.go:Render(powerline) - 89ns
[TRACE] 16:43:42.434 text.go:Render(powerline) - 81ns
[TRACE] 16:43:42.434 text.go:Render( {{ if gt .Code 0 }}{{ else }}{{ end }} ) - 18.184µs
[TRACE] 16:43:42.434 text.go:Render({{ if gt .Code 0 }}p:red{{ end }}) - 9.589µs
[TRACE] 16:43:42.434 text.go:Render(diamond) - 78ns
[TRACE] 16:43:42.434 text.go:Render({{ if gt .Code 0 }}p:red{{ end }}) - 9.654µs
[TRACE] 16:43:42.434 terminal.go:Shell() - 79ns
[TRACE] 16:43:42.434 terminal.go:Shell() - 25ns
[TRACE] 16:43:42.434 terminal.go:Flags() - 53ns
[TRACE] 16:43:42.434 terminal.go:Flags() - 110ns
[TRACE] 16:43:42.434 terminal.go:GOOS() - 76ns
[DEBUG] 16:43:42.434 segment.go:Execute:108 → segment: Time
[TRACE] 16:43:42.434 terminal.go:GOOS() - 56ns
[DEBUG] 16:43:42.434 time.go:Enabled:27 → 15:04:05
[DEBUG] 16:43:42.434 segment.go:Execute:108 → segment: Go
[TRACE] 16:43:42.434 terminal.go:TemplateCache() - 62ns
[TRACE] 16:43:42.434 terminal.go:Flags() - 88ns
[DEBUG] 16:43:42.434 language.go:Enabled:117 → extensions: [*.go go.mod]
[TRACE] 16:43:42.434 terminal.go:GOOS() - 45ns
[TRACE] 16:43:42.434 terminal.go:Flags() - 75ns
[DEBUG] 16:43:42.434 language.go:Enabled:118 → folders: []
[DEBUG] 16:43:42.434 segment.go:Execute:108 → segment: Shell
[DEBUG] 16:43:42.434 language.go:Enabled:125 → home_enabled: false
[TRACE] 16:43:42.434 terminal.go:GOOS() - 77ns
[DEBUG] 16:43:42.434 shell.go:Enabled:26 → mapped_shell_names: map[]
[DEBUG] 16:43:42.434 segment.go:Execute:108 → segment: Python
[TRACE] 16:43:42.434 terminal.go:Flags() - 26ns
[TRACE] 16:43:42.434 terminal.go:Shell() - 42ns
[DEBUG] 16:43:42.434 python.go:Enabled:56 → files
[TRACE] 16:43:42.434 terminal.go:GOOS() - 30ns
[TRACE] 16:43:42.434 terminal.go:Flags() - 69ns
[TRACE] 16:43:42.434 terminal.go:TemplateCache() - 38ns
[DEBUG] 16:43:42.434 language.go:Enabled:118 → folders: [.venv venv virtualenv venv-win pyenv-win]
[DEBUG] 16:43:42.434 language.go:Enabled:125 → home_enabled: false
[DEBUG] 16:43:42.434 language.go:Enabled:117 → extensions: [*.js *.ts package.json .nvmrc pnpm-workspace.yaml .pnpmfile.cjs .vue]
[DEBUG] 16:43:42.434 language.go:Enabled:118 → folders: []
[DEBUG] 16:43:42.434 language.go:Enabled:125 → home_enabled: false
[TRACE] 16:43:42.434 text.go:Render(plain) - 597ns
[TRACE] 16:43:42.434 text.go:Render(plain) - 104ns
[TRACE] 16:43:42.434 text.go:Render(plain) - 68ns
[TRACE] 16:43:42.435 terminal.go:TemplateCache() - 113ns
[TRACE] 16:43:42.435 text.go:Render(in <p:blue><b>{{ .Name }}</b></> ) - 146.361µs
[TRACE] 16:43:42.435 text.go:Render(plain) - 104ns
[TRACE] 16:43:42.435 text.go:Render(at <p:blue><b>{{ .CurrentDate | date "15:04:05" }}</b></>) - 30.602µs
[TRACE] 16:43:42.435 text.go:Render(plain) - 84ns
[TRACE] 16:43:42.435 terminal.go:Shell() - 109ns
[TRACE] 16:43:42.435 terminal.go:Shell() - 41ns
[TRACE] 16:43:42.435 terminal.go:Flags() - 41ns
[TRACE] 16:43:42.435 terminal.go:Shell() - 27ns
[TRACE] 16:43:42.435 terminal.go:Flags() - 22ns
[DEBUG] 16:43:42.435 terminal.go:Getenv:161 → NO DATA
[TRACE] 16:43:42.435 terminal.go:Getenv(LOCALAPPDATA) - 2.407µs
[DEBUG] 16:43:42.435 terminal.go:Getenv:161 → NO DATA
[TRACE] 16:43:42.435 terminal.go:Getenv(OMP_CACHE_DIR) - 1.945µs
[DEBUG] 16:43:42.435 terminal.go:Getenv:161 → NO DATA
[TRACE] 16:43:42.435 terminal.go:Getenv(XDG_CACHE_HOME) - 1.72µs
[TRACE] 16:43:42.435 terminal.go:CachePath() - 23.263µs
[TRACE] 16:43:42.435 terminal.go:Flags() - 23ns