JanDeDobbeleer / oh-my-posh

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

Get-PoshThemes error when scope is machine instead of user #4359

Closed ghost closed 1 year ago

ghost commented 1 year ago

Code of Conduct

What happened?

Get-PoshThemes error when scope is machine instead of user. Actual path for themes is C:\Program Files (x86)\oh-my-posh\themes Screenshot 2023-10-17 131452 Screenshot 2023-10-17 131520 You can see the prompt theme in screenshot because I manually set path.

Theme

issue with all themes

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

Version: 18.13.0

Shell: pwsh (7.3.8)

Prompt:

╭─   drsht  ~                                                                                  0ms   13:21:51 
Γò░ΓöÇ # 

Segments:

ConsoleTitle(false)                        -   0 ms
Os(true)                                   -   1 ms
Session(true)                              -   1 ms
Path(true)                                 -   1 ms
Git(false)                                 -   4 ms
Executiontime(true)                        -   0 ms
Time(true)                                 -   0 ms
Text(true)                                 -   0 ms

Run duration: 11.8246ms

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

Config path: C:\Program Files (x86)\oh-my-posh\themes\quick-term.omp.json

Logs:

[DEBUG] 13:21:51.601 shell.go:Getenv:392 → NO DATA
[TRACE] 13:21:51.601 shell.go:Getenv(TERM_PROGRAM) - 0s
[DEBUG] 13:21:51.601 shell.go:Getenv:392 → C:\Users\drsht\AppData\Local
[TRACE] 13:21:51.601 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 13:21:51.601 shell_windows.go:CachePath() - 0s
[DEBUG] 13:21:51.602 shell.go:Getenv:392 → C:\Program Files (x86)\oh-my-posh\themes\quick-term.omp.json
[TRACE] 13:21:51.602 shell.go:Getenv(POSH_THEME) - 0s
[DEBUG] 13:21:51.602 shell.go:Shell:646 → no shell name provided in flags, trying to detect it
[DEBUG] 13:21:51.607 shell.go:Shell:654 → process name: pwsh.exe
[TRACE] 13:21:51.607 shell.go:Shell() - 4.9871ms
[TRACE] 13:21:51.607 shell.go:resolveConfigPath() - 4.9871ms
[TRACE] 13:21:51.607 shell.go:Init() - 5.4958ms
[TRACE] 13:21:51.607 shell.go:Flags() - 0s
[TRACE] 13:21:51.607 config.go:loadConfig() - 606.8┬╡s
[TRACE] 13:21:51.607 shell.go:Flags() - 0s
[DEBUG] 13:21:51.607 shell.go:Getenv:392 → NO DATA
[TRACE] 13:21:51.607 shell.go:Getenv(OMP_CACHE_DISABLED) - 0s
[TRACE] 13:21:51.607 shell_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[DEBUG] 13:21:51.607 shell_windows.go:WindowsRegistryKeyValue:215 → ColorizationColor(DWORD): 0x003A1461
[TRACE] 13:21:51.607 shell.go:Shell() - 0s
[DEBUG] 13:21:51.607 shell.go:Getenv:392 → 7.3.8
[TRACE] 13:21:51.607 shell.go:Getenv(POSH_SHELL_VERSION) - 0s
[DEBUG] 13:21:51.607 debug.go:PrintDebug:22 → Segment: Title
[DEBUG] 13:21:51.607 text.go:Render:70 → Rendering template: 
[DEBUG] 13:21:51.607 shell.go:Getenv:392 → 30
[TRACE] 13:21:51.607 shell.go:Getenv(POSH_CURSOR_LINE) - 0s
[DEBUG] 13:21:51.607 shell.go:Getenv:392 → 1
[TRACE] 13:21:51.607 shell.go:Getenv(POSH_CURSOR_COLUMN) - 0s
[TRACE] 13:21:51.607 shell.go:Flags() - 0s
[TRACE] 13:21:51.607 shell.go:Flags() - 0s
[TRACE] 13:21:51.607 shell.go:Shell() - 0s
[TRACE] 13:21:51.607 shell.go:Shell() - 0s
[TRACE] 13:21:51.607 shell.go:Flags() - 0s
[TRACE] 13:21:51.607 shell.go:GOOS() - 0s
[DEBUG] 13:21:51.607 shell.go:Pwd:422 → C:\Users\drsht
[TRACE] 13:21:51.607 shell.go:Pwd() - 0s
[DEBUG] 13:21:51.607 shell_windows.go:56 → C:\Users\drsht
[TRACE] 13:21:51.608 shell.go:GOOS() - 0s
[DEBUG] 13:21:51.608 segment.go:SetEnabled:497 → Segment: Git
[TRACE] 13:21:51.608 shell.go:GOOS() - 0s
[TRACE] 13:21:51.608 shell.go:Flags() - 0s
[TRACE] 13:21:51.608 shell.go:Pwd() - 0s
[DEBUG] 13:21:51.608 shell_windows.go:56 → C:\Users\drsht
[TRACE] 13:21:51.608 shell.go:GOOS() - 0s
[DEBUG] 13:21:51.608 segment.go:SetEnabled:497 → Segment: Session
[DEBUG] 13:21:51.608 shell.go:Getenv:392 → NO DATA
[TRACE] 13:21:51.608 shell.go:Getenv(SSH_CONNECTION) - 0s
[DEBUG] 13:21:51.608 shell.go:Getenv:392 → NO DATA
[TRACE] 13:21:51.608 shell.go:Getenv(SSH_CLIENT) - 0s
[TRACE] 13:21:51.608 shell.go:Flags() - 0s
[TRACE] 13:21:51.608 shell.go:Pwd() - 0s
[DEBUG] 13:21:51.608 shell_windows.go:56 → C:\Users\drsht
[TRACE] 13:21:51.608 shell_windows.go:Root() - 0s
[TRACE] 13:21:51.608 shell.go:GOOS() - 0s
[TRACE] 13:21:51.608 shell.go:Shell() - 0s
[TRACE] 13:21:51.608 shell.go:StatusCodes() - 0s
[DEBUG] 13:21:51.608 segment.go:SetEnabled:497 → Segment: Path
[TRACE] 13:21:51.608 shell_windows.go:IsWsl() - 0s
[TRACE] 13:21:51.608 shell.go:Pwd() - 0s
[TRACE] 13:21:51.608 shell.go:Shell() - 0s
[TRACE] 13:21:51.608 shell.go:Flags() - 0s
[TRACE] 13:21:51.608 shell.go:Pwd() - 0s
[DEBUG] 13:21:51.608 shell_windows.go:56 → C:\Users\drsht
[TRACE] 13:21:51.608 shell.go:GOOS() - 0s
[DEBUG] 13:21:51.608 segment.go:SetEnabled:497 → Segment: Os
[TRACE] 13:21:51.608 shell.go:GOOS() - 0s
[DEBUG] 13:21:51.608 shell.go:TemplateCache:827 → environment: [ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\drsht\AppData\Roaming CommonProgramFiles=C:\Program Files\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files COMPUTERNAME=ASUS-VIVOBOOK ComSpec=C:\WINDOWS\system32\cmd.exe CONDA_PROMPT_MODIFIER=False DriverData=C:\Windows\System32\Drivers\DriverData HOMEDRIVE=C: HOMEPATH=\Users\drsht IGCCSVC_DB=AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAScibP4ERXkGv9KreoloAwQQAAAACAAAAAAAQZgAAAAEAACAAAABozswlvEOTvJ+k4UHJGlXvRYS10gFS3BhwfpzSQv89vAAAAAAOgAAAAAIAACAAAAC2dFVJ1R52AsuPDNOvdFiJKxWimacEW8TLvPn0B0ofUGAAAADtbS5iqD4Lkh+lbiZqvlEYxUmmZttzvQJnaQo2SUf+bhePTLOz+mtEP5wbzRhCiM81C7CgZtcz9I09ttJk9JshJEufNz2o5nB9GhmaeegaLNGJ8Ct+Tgq6tRGuAPy1iF5AAAAAqHpmtkPRSpRFaPwdvpEeMNft9qZiUm0Z9Crk6TMHI88iqGsfVr3Ak94zq78aiBoMTbqjzB51J5BlSiUag8eNhQ== LOCALAPPDATA=C:\Users\drsht\AppData\Local LOGONSERVER=\\ASUS-VIVOBOOK NUMBER_OF_PROCESSORS=16 OneDrive=C:\Users\drsht\OneDrive OneDriveConsumer=C:\Users\drsht\OneDrive OS=Windows_NT path=C:\Program Files\PowerShell\7;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\VSCodium\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\oh-my-posh\bin;C:\Program Files\PowerShell\7\;C:\Users\drsht\AppData\Local\Microsoft\WindowsApps;C:\Users\drsht\Applications\mkvtoolnix;C:\platform-tools;C:\Users\drsht\AppData\Local\GitHubDesktop\bin PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL POSH_AZURE_ENABLED=False POSH_CURSOR_COLUMN=1 POSH_CURSOR_LINE=30 POSH_GIT_ENABLED=False POSH_INSTALLER=winget POSH_PID=9300 POSH_SHELL_VERSION=7.3.8 POSH_THEME=C:\Program Files (x86)\oh-my-posh\themes\quick-term.omp.json POSH_THEMES_PATH=C:\Users\drsht\AppData\Local\Programs\oh-my-posh\themes POWERLINE_COMMAND=oh-my-posh POWERSHELL_DISTRIBUTION_CHANNEL=MSI:Windows 10 Home Single Language PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 154 Stepping 3, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=9a03 ProgramData=C:\ProgramData ProgramFiles=C:\Program Files ProgramFiles(x86)=C:\Program Files (x86) ProgramW6432=C:\Program Files PSModulePath=C:\Users\drsht\Documents\PowerShell\Modules;C:\Program Files\PowerShell\Modules;c:\program files\powershell\7\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules PUBLIC=C:\Users\Public SDL_AUDIODRIVER=directsound SESSIONNAME=Console SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\Users\drsht\AppData\Local\Temp TMP=C:\Users\drsht\AppData\Local\Temp USERDOMAIN=ASUS-VIVOBOOK USERDOMAIN_ROAMINGPROFILE=ASUS-VIVOBOOK USERNAME=drsht USERPROFILE=C:\Users\drsht windir=C:\WINDOWS WSLENV=WT_SESSION:WT_PROFILE_ID: WT_PROFILE_ID={727650a7-3f24-4b8e-9669-272c9fa4b7fc} WT_SESSION=54787eec-779b-4bc7-b13d-8b5da3757040 ZES_ENABLE_SYSMAN=1]
[DEBUG] 13:21:51.608 properties.go:GetBool:22 → mapped_locations_enabled: true
[DEBUG] 13:21:51.608 properties.go:GetString:28 → 
[DEBUG] 13:21:51.608 properties.go:GetString:28 → 
[TRACE] 13:21:51.608 shell.go:Pwd() - 0s
[DEBUG] 13:21:51.608 shell_windows.go:56 → C:\Users\drsht
[DEBUG] 13:21:51.608 shell_windows.go:56 → C:\Users\drsht
[TRACE] 13:21:51.608 shell.go:GOOS() - 0s
[TRACE] 13:21:51.608 shell.go:GOOS() - 0s
[TRACE] 13:21:51.608 shell.go:GOOS() - 0s
[TRACE] 13:21:51.608 shell.go:GOOS() - 0s
[TRACE] 13:21:51.608 shell.go:GOOS() - 0s
[TRACE] 13:21:51.608 shell.go:GOOS() - 0s
[TRACE] 13:21:51.608 shell.go:GOOS() - 0s
[TRACE] 13:21:51.608 shell.go:GOOS() - 0s
[TRACE] 13:21:51.608 shell.go:GOOS() - 0s
[TRACE] 13:21:51.608 shell.go:GOOS() - 0s
[DEBUG] 13:21:51.608 properties.go:GetKeyValueMap:46 → mapped_locations: map[]
[DEBUG] 13:21:51.608 shell.go:User:557 → drsht
[TRACE] 13:21:51.608 shell.go:User() - 0s
[TRACE] 13:21:51.608 shell.go:PathSeparator() - 0s
[TRACE] 13:21:51.608 shell.go:GOOS() - 0s
[TRACE] 13:21:51.608 shell.go:GOOS() - 0s
[DEBUG] 13:21:51.608 shell.go:Host:569 → ASUS-Vivobook
[TRACE] 13:21:51.608 shell.go:Host() - 0s
[TRACE] 13:21:51.608 shell.go:GOOS() - 0s
[DEBUG] 13:21:51.608 shell.go:Getenv:392 → NO DATA
[TRACE] 13:21:51.608 shell.go:Getenv(SHLVL) - 0s
[TRACE] 13:21:51.608 shell.go:TemplateCache() - 0s
[TRACE] 13:21:51.609 shell.go:GOOS() - 0s
[TRACE] 13:21:51.609 shell.go:GOOS() - 0s
[TRACE] 13:21:51.609 shell.go:GOOS() - 0s
[TRACE] 13:21:51.609 shell.go:GOOS() - 0s
[TRACE] 13:21:51.609 shell.go:GOOS() - 0s
[TRACE] 13:21:51.609 shell.go:PathSeparator() - 0s
[TRACE] 13:21:51.609 shell.go:PathSeparator() - 0s
[TRACE] 13:21:51.609 shell.go:GOOS() - 0s
[TRACE] 13:21:51.609 shell.go:GOOS() - 0s
[TRACE] 13:21:51.609 shell.go:GOOS() - 0s
[TRACE] 13:21:51.609 shell.go:PathSeparator() - 0s
[TRACE] 13:21:51.609 shell.go:GOOS() - 0s
[TRACE] 13:21:51.609 shell.go:GOOS() - 0s
[TRACE] 13:21:51.609 shell.go:GOOS() - 0s
[TRACE] 13:21:51.609 shell.go:PathSeparator() - 0s
[TRACE] 13:21:51.609 shell.go:GOOS() - 0s
[TRACE] 13:21:51.609 shell.go:GOOS() - 0s
[TRACE] 13:21:51.609 shell.go:GOOS() - 0s
[TRACE] 13:21:51.609 shell.go:PathSeparator() - 0s
[TRACE] 13:21:51.609 shell.go:Pwd() - 0s
[TRACE] 13:21:51.609 shell_windows.go:IsWsl() - 0s
[TRACE] 13:21:51.609 shell.go:StackCount() - 0s
[DEBUG] 13:21:51.610 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 13:21:51.610 win32_windows.go:isWriteable:303 → current user is member of S-1-5-32-544
[DEBUG] 13:21:51.610 win32_windows.go:isWriteable:311 Γåô
    WRITE_DAC
    WRITE_OWNER
    SYNCHRONIZE
    DELETE
    READ_CONTROL
[DEBUG] 13:21:51.610 win32_windows.go:isWriteable:313 → user has write access
[TRACE] 13:21:51.610 shell_windows.go:DirIsWritable() - 702.7┬╡s
[TRACE] 13:21:51.610 shell.go:TemplateCache() - 0s
[ERROR] 13:21:51.611 shell.go:CommandPath:611 → exec: "git.exe": executable file not found in %PATH%
[TRACE] 13:21:51.611 shell.go:CommandPath(git.exe) - 3.6632ms
[TRACE] 13:21:51.611 shell.go:HasCommand(git.exe) - 3.6632ms
[DEBUG] 13:21:51.611 text.go:Render:70 → Rendering template:  {{ .Icon }} 
[DEBUG] 13:21:51.611 text.go:Render:70 → Rendering template:  {{ .UserName }} 
[DEBUG] 13:21:51.611 text.go:Render:70 → Rendering template:  {{ .Path }} 
[TRACE] 13:21:51.612 shell.go:TemplateCache() - 0s
[TRACE] 13:21:51.612 shell.go:Shell() - 0s
[TRACE] 13:21:51.612 shell.go:TemplateCache() - 0s
[TRACE] 13:21:51.612 shell.go:Shell() - 0s
[TRACE] 13:21:51.612 shell.go:TemplateCache() - 0s
[TRACE] 13:21:51.612 shell.go:Shell() - 0s
[DEBUG] 13:21:51.612 shell.go:Getenv:392 → NO DATA
[TRACE] 13:21:51.612 shell.go:Getenv(TERM_PROGRAM) - 0s
[DEBUG] 13:21:51.612 text.go:Render:70 → Rendering template: diamond
[DEBUG] 13:21:51.612 text.go:Render:70 → Rendering template: powerline
[DEBUG] 13:21:51.612 text.go:Render:70 → Rendering template: powerline
[DEBUG] 13:21:51.612 text.go:Render:70 → Rendering template: diamond
[TRACE] 13:21:51.612 shell.go:Shell() - 0s
[TRACE] 13:21:51.612 shell.go:Shell() - 0s
[TRACE] 13:21:51.612 shell.go:Shell() - 0s
[TRACE] 13:21:51.612 shell.go:Flags() - 0s
[TRACE] 13:21:51.612 shell.go:Pwd() - 0s
[DEBUG] 13:21:51.612 shell_windows.go:56 → C:\Users\drsht
[TRACE] 13:21:51.612 shell.go:GOOS() - 0s
[DEBUG] 13:21:51.612 segment.go:SetEnabled:497 → Segment: Time
[DEBUG] 13:21:51.612 properties.go:GetString:28 → 15:04:05
[TRACE] 13:21:51.612 shell.go:TemplateCache() - 0s
[TRACE] 13:21:51.612 shell.go:Flags() - 0s
[TRACE] 13:21:51.612 shell.go:Pwd() - 0s
[DEBUG] 13:21:51.612 shell_windows.go:56 → C:\Users\drsht
[TRACE] 13:21:51.612 shell.go:GOOS() - 0s
[DEBUG] 13:21:51.612 segment.go:SetEnabled:497 → Segment: Executiontime
[DEBUG] 13:21:51.612 properties.go:GetBool:22 → always_enabled: true
[TRACE] 13:21:51.612 shell.go:ExecutionTime() - 0s
[DEBUG] 13:21:51.612 properties.go:GetFloat64:34 → threshold: 500.000000
[DEBUG] 13:21:51.612 properties.go:GetString:28 → austin
[TRACE] 13:21:51.612 shell.go:TemplateCache() - 0s
[DEBUG] 13:21:51.612 text.go:Render:70 → Rendering template:   {{ .CurrentDate | date .Format }} 
[DEBUG] 13:21:51.612 text.go:Render:70 → Rendering template:   {{ .FormattedMs }} 
[TRACE] 13:21:51.612 shell.go:TemplateCache() - 0s
[TRACE] 13:21:51.612 shell.go:TemplateCache() - 0s
[TRACE] 13:21:51.612 shell.go:Shell() - 0s
[TRACE] 13:21:51.612 shell.go:Shell() - 0s
[DEBUG] 13:21:51.612 text.go:Render:70 → Rendering template: powerline
[DEBUG] 13:21:51.612 text.go:Render:70 → Rendering template: diamond
[DEBUG] 13:21:51.612 shell_windows.go:TerminalWidth:109 → terminal width: 120
[TRACE] 13:21:51.612 shell_windows.go:TerminalWidth() - 0s
[TRACE] 13:21:51.612 shell.go:Shell() - 0s
[TRACE] 13:21:51.612 shell.go:Shell() - 0s
[TRACE] 13:21:51.612 shell.go:Shell() - 0s
[TRACE] 13:21:51.612 shell.go:Flags() - 0s
[TRACE] 13:21:51.612 shell.go:Pwd() - 0s
[DEBUG] 13:21:51.612 shell_windows.go:56 → C:\Users\drsht
[TRACE] 13:21:51.612 shell.go:GOOS() - 0s
[DEBUG] 13:21:51.612 segment.go:SetEnabled:497 → Segment: Text
[TRACE] 13:21:51.612 shell.go:TemplateCache() - 0s
[DEBUG] 13:21:51.612 text.go:Render:70 → Rendering template: ╰─ {{ if .Root }}#{{else}}${{end}}
[TRACE] 13:21:51.613 shell.go:TemplateCache() - 0s
[TRACE] 13:21:51.613 shell.go:Shell() - 0s
[DEBUG] 13:21:51.613 shell.go:Getenv:392 → NO DATA
[TRACE] 13:21:51.613 shell.go:Getenv(TERM_PROGRAM) - 0s
[DEBUG] 13:21:51.613 text.go:Render:70 → Rendering template: plain
[TRACE] 13:21:51.613 shell.go:Shell() - 0s
[TRACE] 13:21:51.613 shell.go:Shell() - 0s
[TRACE] 13:21:51.613 shell.go:Shell() - 0s
[DEBUG] 13:21:51.613 shell.go:Getenv:392 → C:\Users\drsht\AppData\Local
[TRACE] 13:21:51.613 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 13:21:51.613 shell_windows.go:CachePath() - 0s
[TRACE] 13:21:51.613 shell.go:Flags() - 0s
JanDeDobbeleer commented 1 year ago

@drshtmstry it gets the location set by $Path = $env:POSH_THEMES_PATH as default, so somehow that one is incorrect. We do validate if you se a Path manually, but not the location of POSH_THEMES_PATH as that should be correct. I'll fix that.

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