JanDeDobbeleer / oh-my-posh

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

In 24.4.0 using a theme in git bash results in a Config Error #5882

Closed ArielLeslie closed 1 week ago

ArielLeslie commented 1 week ago

Code of Conduct

What happened?

After updating oh-my-posh from 23 to 24.4.0, my Git Bash terminal displays CONFIG ERROR if I use any theme. Theming was previously working using a url for a remote config (eg: eval "$(oh-my-posh init bash --config 'https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/jandedobbeleer.omp.json')")

Theme

This is consistent across all themes.

What OS are you seeing the problem on?

Windows

Which shell are you using?

bash

Log output

Version: 24.4.0

Shell: bash (5.2.26(1)-release)

Prompt:

 ariel   \[\\]~\[\\]  CONFIG ERROR  \[\]                                                           in ba
sh at 11:53:27\[
Segments:

ConsoleTitle(true)                        -   0 ms
Session(true)                             -   0 ms
Path(true)                                -   2 ms
Git(false)                                -   1 ms
Root(false)                               -   1 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: 5.6573ms

Cache path: C:\Users\ariel\AppData\Local\oh-my-posh

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

Logs:

[DEBUG] 11:53:27.327 debug.go:50 → debug mode enabled
[DEBUG] 11:53:27.328 debug.go:50 → plain mode enabled
[TRACE] 11:53:27.328 terminal.go() - 0s
[DEBUG] 11:53:27.328 terminal.go:64 → loading cache file: C:\Users\ariel\AppData\Local\oh-my-posh\omp.cache
[DEBUG] 11:53:27.328 terminal.go:64 → loading cache key: upgrade_check
[TRACE] 11:53:27.328 terminal.go(C:\Users\ariel\AppData\Local\oh-my-posh\omp.cache) - 0s
[TRACE] 11:53:27.328 terminal.go() - 0s
[DEBUG] 11:53:27.328 terminal.go:64 → loading cache file: C:\Users\ariel\AppData\Local\oh-my-posh\omp.cache.9b90b0a3-e024-41dd-a930-24c21d157cda
[DEBUG] 11:53:27.328 terminal.go:64 → loading cache key: prompt_count_cache
[DEBUG] 11:53:27.328 terminal.go:64 → loading cache key: template_cache
[TRACE] 11:53:27.328 terminal.go(C:\Users\ariel\AppData\Local\oh-my-posh\omp.cache.9b90b0a3-e024-41dd-a930-24c21d157cda) - 0s
[TRACE] 11:53:27.328 terminal.go:setPromptCount() - 0s
[TRACE] 11:53:27.328 terminal.go:GOOS() - 0s
[DEBUG] 11:53:27.328 terminal.go:setPwd:135 → C:\Users\ariel
[TRACE] 11:53:27.328 terminal.go:setPwd() - 505.2µs
[TRACE] 11:53:27.328 terminal.go:Init() - 1.1988ms
[TRACE] 11:53:27.328 terminal.go:Shell() - 0s
[TRACE] 11:53:27.328 terminal.go:Flags() - 0s
[TRACE] 11:53:27.328 cache.go:loadCache() - 0s
[DEBUG] 11:53:27.328 debug.go:59 → terminal program: Windows Terminal
[DEBUG] 11:53:27.328 debug.go:59 → terminal shell: bash
[DEBUG] 11:53:27.328 terminal.go:Getenv:102 → NO DATA
[TRACE] 11:53:27.328 terminal.go:Getenv(OMP_CACHE_DISABLED) - 0s
[TRACE] 11:53:27.328 terminal_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s
[DEBUG] 11:53:27.328 terminal_windows.go:WindowsRegistryKeyValue:197 → ColorizationColor(DWORD): 0xC4680081
[TRACE] 11:53:27.328 colors_windows.go:GetAccentColor() - 248.4µs
[TRACE] 11:53:27.328 colors.go:SetAccentColor() - 248.4µs
[TRACE] 11:53:27.328 terminal.go:Shell() - 0s
[DEBUG] 11:53:27.328 terminal.go:Getenv:102 → 5.2.26(1)-release
[TRACE] 11:53:27.328 terminal.go:Getenv(POSH_SHELL_VERSION) - 0s
[DEBUG] 11:53:27.328 debug.go:PrintDebug:24 → segment: Title
[TRACE] 11:53:27.328 engine.go:getTitleTemplateText({{ .Shell }} in {{ .Folder }}) - 0s
[TRACE] 11:53:27.328 terminal.go:Flags() - 0s
[DEBUG] 11:53:27.328 terminal.go:Getenv:102 → NO DATA
[TRACE] 11:53:27.328 terminal.go:Getenv(POSH_CURSOR_LINE) - 0s
[DEBUG] 11:53:27.328 terminal.go:Getenv:102 → NO DATA
[TRACE] 11:53:27.328 terminal.go:Getenv(POSH_CURSOR_COLUMN) - 0s
[TRACE] 11:53:27.328 terminal.go:Flags() - 0s
[TRACE] 11:53:27.328 terminal.go:Flags() - 0s
[TRACE] 11:53:27.328 terminal.go:Flags() - 0s
[DEBUG] 11:53:27.328 home.go:Home:16 → C:\Users\ariel
[TRACE] 11:53:27.328 terminal.go:GOOS() - 0s
[DEBUG] 11:53:27.328 segment.go:Execute:108 → segment: Status
[TRACE] 11:53:27.328 terminal.go:StatusCodes() - 0s
[DEBUG] 11:53:27.328 status.go:formatStatus:45 → {{ .Code }}
[TRACE] 11:53:27.329 status.go:formatStatus({{ .Code }}) - 524.5µs
[DEBUG] 11:53:27.329 status.go:Enabled:37 → always_enabled: true
[TRACE] 11:53:27.329 terminal.go:Flags() - 0s
[DEBUG] 11:53:27.329 home.go:Home:16 → C:\Users\ariel
[TRACE] 11:53:27.329 terminal.go:GOOS() - 0s
[DEBUG] 11:53:27.329 segment.go:Execute:108 → segment: Git
[TRACE] 11:53:27.329 terminal.go:GOOS() - 0s
[TRACE] 11:53:27.329 terminal.go:Flags() - 0s
[DEBUG] 11:53:27.329 home.go:Home:16 → C:\Users\ariel
[TRACE] 11:53:27.329 terminal.go:GOOS() - 0s
[DEBUG] 11:53:27.329 segment.go:Execute:108 → segment: Path
[DEBUG] 11:53:27.329 path.go:146 → display_cygpath: false
[TRACE] 11:53:27.329 terminal.go:GOOS() - 0s
[TRACE] 11:53:27.329 path.go:setPaths() - 0s
[TRACE] 11:53:27.329 terminal.go:Shell() - 0s
[TRACE] 11:53:27.329 terminal.go:Shell() - 0s
[TRACE] 11:53:27.329 terminal.go:GOOS() - 0s
[DEBUG] 11:53:27.329 path.go:setMappedLocations:556 → mapped_locations_enabled: true
[DEBUG] 11:53:27.329 path.go:setMappedLocations:557 → 
[DEBUG] 11:53:27.329 path.go:setMappedLocations:558 → 
[DEBUG] 11:53:27.329 home.go:Home:16 → C:\Users\ariel
[TRACE] 11:53:27.329 clean.go:Clean() - 0s
[TRACE] 11:53:27.329 terminal.go:GOOS() - 0s
[DEBUG] 11:53:27.329 path.go:setMappedLocations:559 → ~
[DEBUG] 11:53:27.329 path.go:setMappedLocations:564 → mapped_locations: map[]
[TRACE] 11:53:27.329 clean.go:Clean() - 0s
[TRACE] 11:53:27.329 terminal.go:GOOS() - 0s
[TRACE] 11:53:27.329 clean.go:Clean() - 0s
[TRACE] 11:53:27.329 terminal.go:GOOS() - 0s
[TRACE] 11:53:27.329 terminal.go:GOOS() - 0s
[TRACE] 11:53:27.329 terminal.go:GOOS() - 0s
[TRACE] 11:53:27.329 terminal.go:GOOS() - 0s
[TRACE] 11:53:27.329 terminal.go:Flags() - 0s
[DEBUG] 11:53:27.329 path.go:colorizePath:733 → cycle: []
[DEBUG] 11:53:27.329 path.go:getFolderSeparator:266 → NO DATA
[DEBUG] 11:53:27.329 path.go:getFolderSeparator:268 → \
[DEBUG] 11:53:27.329 path.go:colorizePath:736 → cycle_folder_separator: false
[DEBUG] 11:53:27.329 path.go:colorizePath:737 → %s
[DEBUG] 11:53:27.329 path.go:colorizePath:739 → %s
[DEBUG] 11:53:27.329 path.go:colorizePath:740 → %s
[DEBUG] 11:53:27.329 path.go:colorizePath:741 → %s
[TRACE] 11:53:27.329 terminal.go:Flags() - 0s
[TRACE] 11:53:27.329 terminal.go:GOOS() - 0s
[TRACE] 11:53:27.329 terminal.go:Flags() - 0s
[TRACE] 11:53:27.329 terminal.go:StackCount() - 0s
[DEBUG] 11:53:27.329 home.go:Home:16 → C:\Users\ariel
[TRACE] 11:53:27.329 terminal.go:GOOS() - 0s
[DEBUG] 11:53:27.329 segment.go:Execute:108 → segment: Root
[TRACE] 11:53:27.329 terminal.go:Flags() - 0s
[DEBUG] 11:53:27.329 home.go:Home:16 → C:\Users\ariel
[TRACE] 11:53:27.329 terminal.go:GOOS() - 0s
[DEBUG] 11:53:27.329 segment.go:Execute:108 → segment: Session
[DEBUG] 11:53:27.329 terminal.go:Getenv:102 → NO DATA
[TRACE] 11:53:27.330 terminal.go:Getenv(SSH_CONNECTION) - 512.4µs
[DEBUG] 11:53:27.330 terminal.go:Getenv:102 → NO DATA
[TRACE] 11:53:27.330 terminal.go:Getenv(SSH_CLIENT) - 0s
[DEBUG] 11:53:27.330 terminal.go:CommandPath:337 → C:\Program Files\Git\mingw64\bin\git.exe
[TRACE] 11:53:27.330 terminal.go:CommandPath(git.exe) - 668.9µs
[TRACE] 11:53:27.330 terminal.go:HasCommand(git.exe) - 668.9µs
[DEBUG] 11:53:27.330 git.go:shouldDisplay:327 → fetch_bare_info: false
[DEBUG] 11:53:27.330 terminal.go:ResolveSymlink:228 → C:\Users\ariel
[TRACE] 11:53:27.330 terminal.go:ResolveSymlink(C:\Users\ariel) - 678.5µs
[TRACE] 11:53:27.330 segment.go:string( {{ if .SSHSession }} {{ end }}{{ .UserName }} ) - 745.6µs
[TRACE] 11:53:27.331 segment.go:resolve(diamond) - 0s
[ERROR] 11:53:27.331 terminal.go:HasParentFilePath:503 → CreateFile .git: The system cannot find the file specified.
[TRACE] 11:53:27.331 terminal.go:HasParentFilePath(.git) - 1.2829ms
[TRACE] 11:53:27.331 terminal_windows.go:Root() - 1.8624ms
[DEBUG] 11:53:27.331 win32_windows.go:isWriteable:258 → not current user or in group
[DEBUG] 11:53:27.331 win32_windows.go:isWriteable:262 → current user is member of S-1-5-32-544
[DEBUG] 11:53:27.331 win32_windows.go:isWriteable:270 ↓
    WRITE_DAC
    WRITE_OWNER
    SYNCHRONIZE
    DELETE
    READ_CONTROL
[DEBUG] 11:53:27.332 win32_windows.go:isWriteable:272 → user has write access
[TRACE] 11:53:27.332 terminal_windows.go:DirIsWritable() - 2.9778ms
[TRACE] 11:53:27.332 segment.go:string(  {{ path .Path .Location }} ) - 95µs
[TRACE] 11:53:27.332 segment.go:resolve(powerline) - 0s
[TRACE] 11:53:27.332 segment.go:resolve(powerline) - 0s
[TRACE] 11:53:27.332 segment.go:resolve(powerline) - 0s
[TRACE] 11:53:27.332 segment.go:string( CONFIG ERROR ) - 0s
[TRACE] 11:53:27.332 list.go:FirstMatch(p:red) - 0s
[TRACE] 11:53:27.332 segment.go:resolve(diamond) - 0s
[TRACE] 11:53:27.332 list.go:FirstMatch(p:red) - 0s
[TRACE] 11:53:27.332 terminal.go:Shell() - 0s
[TRACE] 11:53:27.332 terminal.go:Shell() - 0s
[TRACE] 11:53:27.332 terminal.go:Flags() - 0s
[DEBUG] 11:53:27.332 home.go:Home:16 → C:\Users\ariel
[TRACE] 11:53:27.332 terminal.go:GOOS() - 0s
[DEBUG] 11:53:27.332 segment.go:Execute:108 → segment: Time
[TRACE] 11:53:27.332 terminal.go:Flags() - 0s
[TRACE] 11:53:27.332 terminal.go:Flags() - 0s
[DEBUG] 11:53:27.332 time.go:Enabled:27 → 15:04:05
[TRACE] 11:53:27.332 terminal.go:Flags() - 0s
[DEBUG] 11:53:27.332 home.go:Home:16 → C:\Users\ariel
[TRACE] 11:53:27.332 terminal.go:GOOS() - 0s
[DEBUG] 11:53:27.332 segment.go:Execute:108 → segment: Shell
[DEBUG] 11:53:27.332 home.go:Home:16 → C:\Users\ariel
[TRACE] 11:53:27.332 terminal.go:GOOS() - 0s
[DEBUG] 11:53:27.332 shell.go:Enabled:26 → mapped_shell_names: map[]
[DEBUG] 11:53:27.332 segment.go:Execute:108 → segment: Python
[DEBUG] 11:53:27.332 home.go:Home:16 → C:\Users\ariel
[TRACE] 11:53:27.332 terminal.go:Shell() - 0s
[TRACE] 11:53:27.332 terminal.go:GOOS() - 0s
[TRACE] 11:53:27.332 terminal.go:Flags() - 0s
[DEBUG] 11:53:27.332 segment.go:Execute:108 → segment: Go
[DEBUG] 11:53:27.332 home.go:Home:16 → C:\Users\ariel
[DEBUG] 11:53:27.332 python.go:Enabled:56 → files
[TRACE] 11:53:27.332 terminal.go:GOOS() - 0s
[DEBUG] 11:53:27.332 segment.go:Execute:108 → segment: Node
[DEBUG] 11:53:27.332 language.go:Enabled:117 → extensions: [*.py *.ipynb pyproject.toml venv.bak]
[DEBUG] 11:53:27.332 language.go:Enabled:118 → folders: [.venv venv virtualenv venv-win pyenv-win]
[DEBUG] 11:53:27.332 language.go:Enabled:117 → extensions: [*.go go.mod]
[DEBUG] 11:53:27.332 language.go:Enabled:118 → folders: []
[DEBUG] 11:53:27.332 home.go:Home:16 → C:\Users\ariel
[DEBUG] 11:53:27.332 language.go:Enabled:125 → home_enabled: false
[DEBUG] 11:53:27.332 home.go:Home:16 → C:\Users\ariel
[TRACE] 11:53:27.332 segment.go:resolve(plain) - 0s
[TRACE] 11:53:27.332 segment.go:resolve(plain) - 0s
[TRACE] 11:53:27.332 segment.go:resolve(plain) - 0s
[TRACE] 11:53:27.332 segment.go:string(in <p:blue><b>{{ .Name }}</b></> ) - 0s
[TRACE] 11:53:27.332 segment.go:resolve(plain) - 0s
[TRACE] 11:53:27.332 segment.go:string(at <p:blue><b>{{ .CurrentDate | date "15:04:05" }}</b></>) - 0s
[TRACE] 11:53:27.332 segment.go:resolve(plain) - 0s
[TRACE] 11:53:27.332 terminal.go:Shell() - 0s
[TRACE] 11:53:27.332 terminal.go:Shell() - 0s
[TRACE] 11:53:27.333 terminal.go:Flags() - 0s
[TRACE] 11:53:27.333 terminal.go:Shell() - 0s
[DEBUG] 11:53:27.333 terminal_windows.go:TerminalWidth:98 → terminal width: 111
[TRACE] 11:53:27.333 terminal_windows.go:TerminalWidth() - 0s
[TRACE] 11:53:27.333 debug.go:PrintDebug() - 0s
[TRACE] 11:53:27.333 terminal.go:Flags() - 0s
JanDeDobbeleer commented 1 week ago

@ArielLeslie on it in about an hour. I refactored this, but thought I validated this. Nonetheless, I'm going to solve this one asap.

JanDeDobbeleer commented 1 week ago

@ArielLeslie fixed and validated. This was a serious bug, thanks for reporting it so swiftly. I didn't notice it because I set my config using the internal API 🤦🏻

ArielLeslie commented 1 week ago

Thanks for the fast patch! Everything looks pretty again!