JanDeDobbeleer / oh-my-posh

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

Wrong profile location for PowerShell 7.x on Windows #2836

Closed ebbek closed 2 years ago

ebbek commented 2 years ago

Code of Conduct

What happened?

When updating oh-my-posh using chocolatey, I get this message:

oh-my-posh has been installed. PROFILE: C:\Users\ebbek\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 No Powershell profile was found. You may wish to create a profile and append 'Invoke-Expression (oh-my-posh --init --shell pwsh --config " C:\Program Files (x86)/oh-my-posh/themes/themename.omp.json")' to enable oh-my-posh. 'Get-PoshThemes' will list available themes for you

I use PowerShell 7.2.6 and it keeps its profile in C:\Users\<username>\Documents\PowerShell, probably reflecting that this version is not Windows-only,

Everything works. It is only the message that is wrong so this bug can be prioritized low.

Theme

{ "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", "blocks": [ { "alignment": "left", "newline": true, "segments": [ { "foreground": "#757575", "properties": { "display_host": true }, "style": "plain", "template": "\u250c {{ if .SSHSession }}\uf817 {{ end }}{{ .UserName }}@{{ .HostName }} ", "type": "session" }, { "foreground": "#FFFFFF", "properties": { "mapped_shell_names": { "bash": "SH", "pwsh": "PS", "universal": "TC" } }, "style": "plain", "template": "{{ .Name }} ", "type": "shell" }, { "background": "#91ddff", "foreground": "#100e23", "leading_diamond": "\ue0b6", "properties": { "style": "full" }, "style": "diamond", "template": " {{ .Path }} ", "trailing_diamond": "\ue0b4", "type": "path" }, { "background": "#00897b", "background_templates": [ "{{ if gt .Code 0 }}#e91e63{{ end }}" ], "foreground": "#ffffff", "leading_diamond": "\ue0b6", "properties": { "always_enabled": false }, "style": "diamond", "template": "{{ .Code }} - {{.Meaning}} ", "trailing_diamond": "\ue0b4", "type": "exit" } ], "type": "prompt" }, { "alignment": "right", "segments": [ { "background": "#95ffa4", "background_templates": [ "{{ if or (.Working.Changed) (.Staging.Changed) }}#ff9248{{ end }}", "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#f26d50{{ end }}", "{{ if gt .Ahead 0 }}#F13D37{{ end }}", "{{ if gt .Behind 0 }}#89d1dc{{ end }}" ], "foreground": "#100e23", "leading_diamond": "\ue0b6", "properties": { "azure_devops_icon": "\ufd03", "branch_ahead_icon": "\u2191", "branch_behind_icon": "\u2193", "branch_gone": "\u2262", "branch_icon": "\ue0a0 ", "branch_identical_icon": "\u2261", "butbucket_icon": "\uf171 ", "fetch_stash_count": true, "fetch_status": true, "fetch_upstream_icon": true, "git_icon": "\ue702", "github_icon": "\uf113", "gitlab_icon": "\uf296" }, "style": "diamond", "template": " {{ .UpstreamIcon }} {{ .HEAD }} {{ .BranchStatus }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if and (.Staging.Changed) (.Working.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0}}\uf56e {{ .StashCount }}{{ end }}{{ if gt .WorktreeCount 0}} \uf1bb {{ .WorktreeCount }}{{ end }} ", "trailing_diamond": "\ue0b4", "type": "git" }, { "type": "svn", "style": "diamond", "leading_diamond": "\ue0b6", "trailing_diamond": "\ue0b4", "powerline_symbol": "\uE0B0", "foreground": "#193549", "background": "#ffeb3b", "properties": { "fetch_status": true, "fetch_stash_count": true, "fetch_upstream_icon": true, "template": " \ue0a0{{ .Branch }} r{{ .BaseRev }} {{ .Working.String }} " } }, { "foreground": "#ff8080", "properties": { "root_icon": "root" }, "style": "plain", "template": " <#757575,>as</> root", "type": "root" } ], "type": "prompt" }, { "alignment": "left", "newline": true, "segments": [ { "foreground": "#757575", "style": "plain", "template": "\u2514", "type": "text" }, { "foreground": "#ffffff", "style": "plain", "template": " $", "type": "text" } ], "type": "prompt" } ], "console_title_template": "{{.Env.PROJECT_NAME}}", "final_space": true, "version": 2 }

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

Version: 10.3.0

Segments:

ConsoleTitle(true) -   0 ms - No Project
session(true)  -   0 ms - ┌ ebbek@DELLI
shell(true)    -   0 ms - PS
path(true)     -   0 ms -  ~ 
exit(false)    -   0 ms -
git(false)     -   8 ms -
svn(false)     -  12 ms -
root(false)    -   0 ms -
text(true)     -   0 ms - └
text(true)     -   0 ms -  $

Run duration: 36.6642ms

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

Config path: C:\Users\ebbek\ekologic.omp.json

Logs:

2022/09/26 06:37:23 debug: Getenv
C:\Users\ebbek\AppData\Local
2022/09/26 06:37:23 Getenv duration: 0s, args: LOCALAPPDATA
2022/09/26 06:37:23 CachePath duration: 0s, args:
2022/09/26 06:37:23 debug: Getenv
C:\Users\ebbek\ekologic.omp.json
2022/09/26 06:37:23 Getenv duration: 0s, args: POSH_THEME
2022/09/26 06:37:23 debug: Shell
process name: pwsh.exe
2022/09/26 06:37:23 Shell duration: 10.4476ms, args:
2022/09/26 06:37:23 resolveConfigPath duration: 10.4476ms, args:
2022/09/26 06:37:23 Init duration: 11.6718ms, args:
2022/09/26 06:37:23 Flags duration: 0s, args:
2022/09/26 06:37:23 config.loadConfig duration: 988.6µs, args:
2022/09/26 06:37:23 Flags duration: 0s, args:
2022/09/26 06:37:23 debug: Getenv

2022/09/26 06:37:23 Getenv duration: 0s, args: OMP_CACHE_DISABLED
2022/09/26 06:37:23 WindowsRegistryKeyValue duration: 0s, args: HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 debug: WindowsRegistryKeyValue
ColorizationColor(DWORD): 0xC40078D4
2022/09/26 06:37:23 Root duration: 0s, args:
2022/09/26 06:37:23 Shell duration: 0s, args:
2022/09/26 06:37:23 ErrorCode duration: 0s, args:
2022/09/26 06:37:23 IsWsl duration: 0s, args:
2022/09/26 06:37:23 debug: Pwd
C:\Users\ebbek
2022/09/26 06:37:23 Pwd duration: 0s, args:
2022/09/26 06:37:23 debug: Home
C:\Users\ebbek
2022/09/26 06:37:23 debug: Home
C:\Users\ebbek
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 debug: User
ebbek
2022/09/26 06:37:23 User duration: 0s, args:
2022/09/26 06:37:23 debug: Host
DELLI
2022/09/26 06:37:23 Host duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 TemplateCache duration: 0s, args:
2022/09/26 06:37:23 Flags duration: 0s, args:
2022/09/26 06:37:23 debug: Pwd
C:\Users\ebbek
2022/09/26 06:37:23 Pwd duration: 0s, args:
2022/09/26 06:37:23 debug: Home
C:\Users\ebbek
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 debug: Getenv

2022/09/26 06:37:23 Getenv duration: 0s, args: SSH_CONNECTION
2022/09/26 06:37:23 debug: Getenv

2022/09/26 06:37:23 Getenv duration: 0s, args: SSH_CLIENT
2022/09/26 06:37:23 TemplateCache duration: 0s, args:
2022/09/26 06:37:23 TemplateCache duration: 0s, args:
2022/09/26 06:37:23 Shell duration: 0s, args:
2022/09/26 06:37:23 debug: Pwd
C:\Users\ebbek
2022/09/26 06:37:23 Pwd duration: 0s, args:
2022/09/26 06:37:23 debug: Home
C:\Users\ebbek
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 Shell duration: 0s, args:
2022/09/26 06:37:23 Flags duration: 0s, args:
2022/09/26 06:37:23 TemplateCache duration: 0s, args:
2022/09/26 06:37:23 TemplateCache duration: 0s, args:
2022/09/26 06:37:23 Shell duration: 0s, args:
2022/09/26 06:37:23 debug: Pwd
C:\Users\ebbek
2022/09/26 06:37:23 Pwd duration: 0s, args:
2022/09/26 06:37:23 debug: Home
C:\Users\ebbek
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 debug: Pwd
C:\Users\ebbek
2022/09/26 06:37:23 Pwd duration: 0s, args:
2022/09/26 06:37:23 Flags duration: 0s, args:
2022/09/26 06:37:23 debug: Pwd
C:\Users\ebbek
2022/09/26 06:37:23 Pwd duration: 0s, args:
2022/09/26 06:37:23 debug: Home
C:\Users\ebbek
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 PathSeparator duration: 0s, args:
2022/09/26 06:37:23 PathSeparator duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 IsWsl duration: 0s, args:
2022/09/26 06:37:23 StackCount duration: 0s, args:
2022/09/26 06:37:23 DirIsWritable duration: 414.1µs, args:
2022/09/26 06:37:23 TemplateCache duration: 0s, args:
2022/09/26 06:37:23 TemplateCache duration: 0s, args:
2022/09/26 06:37:23 Shell duration: 0s, args:
2022/09/26 06:37:23 debug: Pwd
C:\Users\ebbek
2022/09/26 06:37:23 Pwd duration: 0s, args:
2022/09/26 06:37:23 debug: Home
C:\Users\ebbek
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 ErrorCode duration: 0s, args:
2022/09/26 06:37:23 ErrorCode duration: 0s, args:
2022/09/26 06:37:23 Flags duration: 0s, args:
2022/09/26 06:37:23 debug: Pwd
C:\Users\ebbek
2022/09/26 06:37:23 Pwd duration: 0s, args:
2022/09/26 06:37:23 debug: Home
C:\Users\ebbek
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 debug: CommandPath
C:\Program Files\Git\cmd\git.exe
2022/09/26 06:37:23 CommandPath duration: 8.9999ms, args: git.exe
2022/09/26 06:37:23 HasCommand duration: 8.9999ms, args: git.exe
2022/09/26 06:37:23 debug: Pwd
C:\Users\ebbek
2022/09/26 06:37:23 Pwd duration: 0s, args:
2022/09/26 06:37:23 error: HasParentFilePath
CreateFile C:\.git: The system cannot find the file specified.
2022/09/26 06:37:23 HasParentFilePath duration: 0s, args: .git
2022/09/26 06:37:23 debug: Pwd
C:\Users\ebbek
2022/09/26 06:37:23 Pwd duration: 0s, args:
2022/09/26 06:37:23 debug: Home
C:\Users\ebbek
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 debug: Getenv
C:\Users\ebbek\AppData\Local
2022/09/26 06:37:23 Getenv duration: 0s, args: LOCALAPPDATA
2022/09/26 06:37:23 PathSeparator duration: 0s, args:
2022/09/26 06:37:23 debug: HasFilesInDir
false
2022/09/26 06:37:23 HasFilesInDir duration: 0s, args: svn.exe.exe
2022/09/26 06:37:23 error: CommandPath
no Windows Store App
2022/09/26 06:37:23 CommandPath duration: 12.9981ms, args: svn.exe
2022/09/26 06:37:23 HasCommand duration: 12.9981ms, args: svn.exe
2022/09/26 06:37:23 debug: Pwd
C:\Users\ebbek
2022/09/26 06:37:23 Pwd duration: 0s, args:
2022/09/26 06:37:23 debug: Home
C:\Users\ebbek
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 Root duration: 0s, args:
2022/09/26 06:37:23 Flags duration: 0s, args:
2022/09/26 06:37:23 debug: Pwd
C:\Users\ebbek
2022/09/26 06:37:23 Pwd duration: 0s, args:
2022/09/26 06:37:23 debug: Home
C:\Users\ebbek
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 TemplateCache duration: 0s, args:
2022/09/26 06:37:23 TemplateCache duration: 0s, args:
2022/09/26 06:37:23 Shell duration: 0s, args:
2022/09/26 06:37:23 debug: Pwd
C:\Users\ebbek
2022/09/26 06:37:23 Pwd duration: 0s, args:
2022/09/26 06:37:23 debug: Home
C:\Users\ebbek
2022/09/26 06:37:23 GOOS duration: 0s, args:
2022/09/26 06:37:23 TemplateCache duration: 0s, args:
2022/09/26 06:37:23 TemplateCache duration: 0s, args:
2022/09/26 06:37:23 Shell duration: 0s, args:
2022/09/26 06:37:23 debug: Getenv
C:\Users\ebbek\AppData\Local
2022/09/26 06:37:23 Getenv duration: 0s, args: LOCALAPPDATA
2022/09/26 06:37:23 CachePath duration: 502µs, args:
2022/09/26 06:37:23 Flags duration: 0s, args:
JanDeDobbeleer commented 2 years ago

@ebbek the chocolatey package isn't maintained by us. You can create a bug for @digitalcoyote.

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.