Closed jakubnavratil closed 2 years ago
same as https://github.com/JanDeDobbeleer/oh-my-posh/issues/1415 This has been fixed starting from v6.33.1
Tested and seems to be fixed. Thanks! 😄
Ok change from v6.33.0 to v6.33.1 unfortunatelly causes others bugs:
before update:
after update:
if directory DOES NOT start with letter "a": (node segment still missing)
Ok that node segment seems to be affected by casing of the last path segment:
can you show the result of the debug command?
❯ brista"oh-my-posh --debug --shell uni --config="$POSH_THEME"
Version: 6.33.1
Segments:
ConsoleTitle(true) - 0 ms -
os(true) - 0 ms -
path(true) - 0 ms - D: abrista
node(false) - 0 ms -
git(false) - 18 ms -
executiontime(true) - 0 ms - 0ms
root(false) - 0 ms -
session(true) - 3 ms - Kuba
shell(true) - 0 ms - uni
root(false) - 0 ms -
text(true) - 0 ms - ❯
Run duration: 21.5896ms
Logs:
2021/12/16 15:00:36 debug: getenv
C:\Users\Kuba\AppData\Local
2021/12/16 15:00:36 getenv duration: 518µs, args: LOCALAPPDATA
2021/12/16 15:00:36 getCachePath duration: 1.033ms, args:
2021/12/16 15:00:36 getArgs duration: 0s, args:
2021/12/16 15:00:36 getArgs duration: 0s, args:
2021/12/16 15:00:36 getShellName duration: 0s, args:
2021/12/16 15:00:36 debug: getenv
2021/12/16 15:00:36 getenv duration: 0s, args: OMP_CACHE_DISABLED
2021/12/16 15:00:36 isRunningAsRoot duration: 0s, args:
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getShellName duration: 0s, args:
2021/12/16 15:00:36 getCurrentUser duration: 0s, args:
2021/12/16 15:00:36 getHostName duration: 0s, args:
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 getRuntimeGOOS duration: 0s, args:
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 getArgs duration: 0s, args:
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 getRuntimeGOOS duration: 0s, args:
2021/12/16 15:00:36 getRuntimeGOOS duration: 0s, args:
2021/12/16 15:00:36 getArgs duration: 0s, args:
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 getRuntimeGOOS duration: 0s, args:
2021/12/16 15:00:36 getRuntimeGOOS duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getRuntimeGOOS duration: 0s, args:
2021/12/16 15:00:36 isWsl duration: 0s, args:
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 hasFiles duration: 0s, args: *.js
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 hasFiles duration: 0s, args: *.ts
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 hasFiles duration: 0s, args: package.json
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 hasFiles duration: 0s, args: .nvmrc
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 hasFiles duration: 0s, args: pnpm-workspace.yaml
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 hasFiles duration: 0s, args: .pnpmfile.cjs
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 hasFiles duration: 0s, args: .npmrc
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 getRuntimeGOOS duration: 0s, args:
2021/12/16 15:00:36 hasCommand duration: 17.5077ms, args: git.exe
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 error: hasParentFilePath
CreateFile D:\.git: Systém nemůže nalézt uvedený soubor.
2021/12/16 15:00:36 hasParentFilePath duration: 514.8µs, args: .git
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 executionTime duration: 0s, args:
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 isRunningAsRoot duration: 0s, args:
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 debug: getenv
2021/12/16 15:00:36 getenv duration: 0s, args: SSH_CONNECTION
2021/12/16 15:00:36 debug: getenv
2021/12/16 15:00:36 getenv duration: 0s, args: SSH_CLIENT
2021/12/16 15:00:36 getCurrentUser duration: 0s, args:
2021/12/16 15:00:36 getRuntimeGOOS duration: 0s, args:
2021/12/16 15:00:36 getHostName duration: 0s, args:
2021/12/16 15:00:36 isRunningAsRoot duration: 0s, args:
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 getShellName duration: 0s, args:
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 isRunningAsRoot duration: 0s, args:
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 isRunningAsRoot duration: 0s, args:
2021/12/16 15:00:36 getcwd duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getPathSeperator duration: 0s, args:
2021/12/16 15:00:36 getShellName duration: 0s, args:
2021/12/16 15:00:36 getCurrentUser duration: 0s, args:
2021/12/16 15:00:36 getHostName duration: 0s, args:
Ok, that error with partial folder name is fixed, when osc99: false
Dunno why I was using true, I guess it was in theme I used.
But why isn't node segment showing when folder starts with capital name?
Log from folder with capital Letter (node not showing):
oh-my-posh --debug --shell uni --config="$POSH_THEME"
Version: 6.33.1
Segments:
ConsoleTitle(true) - 0 ms -
os(true) - 0 ms -
path(true) - 0 ms -
node(false) - 0 ms -
git(false) - 17 ms -
executiontime(true) - 0 ms - 0ms
root(false) - 0 ms -
session(true) - 0 ms - Kuba
shell(true) - 0 ms - uni
root(false) - 0 ms -
text(true) - 0 ms - ❯
Run duration: 18.9651ms
Logs:
2021/12/16 15:16:43 debug: getenv
C:\Users\Kuba\AppData\Local
2021/12/16 15:16:43 getenv duration: 0s, args: LOCALAPPDATA
2021/12/16 15:16:43 getCachePath duration: 0s, args:
2021/12/16 15:16:43 getArgs duration: 0s, args:
2021/12/16 15:16:43 getArgs duration: 0s, args:
2021/12/16 15:16:43 getShellName duration: 0s, args:
2021/12/16 15:16:43 debug: getenv
2021/12/16 15:16:43 getenv duration: 0s, args: OMP_CACHE_DISABLED
2021/12/16 15:16:43 isRunningAsRoot duration: 0s, args:
2021/12/16 15:16:43 getcwd duration: 0s, args:
2021/12/16 15:16:43 getPathSeperator duration: 0s, args:
2021/12/16 15:16:43 getPathSeperator duration: 0s, args:
2021/12/16 15:16:43 getShellName duration: 0s, args:
2021/12/16 15:16:43 getCurrentUser duration: 0s, args:
2021/12/16 15:16:43 getHostName duration: 0s, args:
2021/12/16 15:16:43 getcwd duration: 0s, args:
2021/12/16 15:16:43 getRuntimeGOOS duration: 0s, args:
2021/12/16 15:16:43 getcwd duration: 0s, args:
2021/12/16 15:16:43 getcwd duration: 0s, args:
2021/12/16 15:16:43 getArgs duration: 0s, args:
2021/12/16 15:16:43 getcwd duration: 0s, args:
2021/12/16 15:16:43 getRuntimeGOOS duration: 0s, args:
2021/12/16 15:16:43 getRuntimeGOOS duration: 0s, args:
2021/12/16 15:16:43 getArgs duration: 0s, args:
2021/12/16 15:16:43 getcwd duration: 0s, args:
2021/12/16 15:16:43 getRuntimeGOOS duration: 0s, args:
2021/12/16 15:16:43 getRuntimeGOOS duration: 0s, args:
2021/12/16 15:16:43 getPathSeperator duration: 0s, args:
2021/12/16 15:16:43 getPathSeperator duration: 0s, args:
2021/12/16 15:16:43 getPathSeperator duration: 0s, args:
2021/12/16 15:16:43 getPathSeperator duration: 0s, args:
2021/12/16 15:16:43 getRuntimeGOOS duration: 0s, args:
2021/12/16 15:16:43 isWsl duration: 0s, args:
2021/12/16 15:16:43 getcwd duration: 0s, args:
2021/12/16 15:16:43 getcwd duration: 0s, args:
2021/12/16 15:16:43 getcwd duration: 0s, args:
2021/12/16 15:16:43 getRuntimeGOOS duration: 0s, args:
2021/12/16 15:16:43 hasCommand duration: 17.4512ms, args: git.exe
2021/12/16 15:16:43 getcwd duration: 0s, args:
2021/12/16 15:16:43 error: hasParentFilePath
CreateFile C:\.git: Systém nemůže nalézt uvedený soubor.
2021/12/16 15:16:43 hasParentFilePath duration: 0s, args: .git
2021/12/16 15:16:43 getcwd duration: 0s, args:
2021/12/16 15:16:43 executionTime duration: 0s, args:
2021/12/16 15:16:43 getcwd duration: 0s, args:
2021/12/16 15:16:43 isRunningAsRoot duration: 0s, args:
2021/12/16 15:16:43 getcwd duration: 0s, args:
2021/12/16 15:16:43 debug: getenv
2021/12/16 15:16:43 getenv duration: 0s, args: SSH_CONNECTION
2021/12/16 15:16:43 debug: getenv
2021/12/16 15:16:43 getenv duration: 0s, args: SSH_CLIENT
2021/12/16 15:16:43 getCurrentUser duration: 0s, args:
2021/12/16 15:16:43 getRuntimeGOOS duration: 0s, args:
2021/12/16 15:16:43 getHostName duration: 0s, args:
2021/12/16 15:16:43 isRunningAsRoot duration: 0s, args:
2021/12/16 15:16:43 getcwd duration: 0s, args:
2021/12/16 15:16:43 getShellName duration: 0s, args:
2021/12/16 15:16:43 getcwd duration: 0s, args:
2021/12/16 15:16:43 isRunningAsRoot duration: 0s, args:
2021/12/16 15:16:43 getcwd duration: 0s, args:
2021/12/16 15:16:43 isRunningAsRoot duration: 0s, args:
2021/12/16 15:16:43 getcwd duration: 0s, args:
2021/12/16 15:16:43 getPathSeperator duration: 0s, args:
2021/12/16 15:16:43 getPathSeperator duration: 0s, args:
2021/12/16 15:16:43 getShellName duration: 0s, args:
2021/12/16 15:16:43 getCurrentUser duration: 0s, args:
2021/12/16 15:16:43 getHostName duration: 0s, args:
if you call --print-init --shell bash
, do you get this:
Yes, I got this version (6.33.1)
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.
Code of Conduct
What happened?
When using path style "agnoster", which uses
os.PathSeparator
in GitBash on Windows, path is not splitted into segments. Same thing works correctly in powershell on the same system.I looked into this and failed to find solution other then submitting this issue. Maybe env.getPathSeperator() could be using some detection for this case?
Theme
{ "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", "osc99": true, "final_space": true, "console_title": true, "blocks": [ { "type": "prompt", "alignment": "left", "segments": [ { "type": "os", "style": "diamond", "foreground": "#ffffff", "background": "#c44569", "leading_diamond": "\uE0B6", "trailing_diamond": "", "properties": { "prefix": "", "windows": "\uE62A", "postfix": " " } }, { "type": "path", "style": "powerline", "trailing_diamond": "\uE0B0", "foreground": "#ffffff", "background": "#c44569", "properties": { "folder_separator_icon": " <#011627>\uE0B1</> ", "home_icon": "\uf7db ", "folder_icon": "\uf07c ", "style": "agnoster", "enable_hyperlink": true } }, { "type": "node", "style": "powerline", "powerline_symbol": "\uE0B0", "foreground": "#ffffff", "background": "#6CA35E", "properties": { "prefix": " \uE718 " } }, { "type": "git", "style": "powerline", "powerline_symbol": "\uE0B0", "foreground": "#193549", "background": "#caffbf", "background_templates": [ "{{ if or (.Working.Changed) (.Staging.Changed) }}#FCA17D{{ end }}", "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#f26d50{{ end }}", "{{ if gt .Ahead 0 }}#89d1dc{{ end }}", "{{ if gt .Behind 0 }}#f17c37{{ end }}" ], "properties": { "fetch_upstream_icon": true, "fetch_status": true, "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}" } } ] }, { "type": "prompt", "alignment": "right", "segments": [ { "type": "executiontime", "style": "powerline", "powerline_symbol": "\uE0B2", "invert_powerline": true, "foreground": "#ffffff", "background": "#83769c", "properties": { "always_enabled": true } }, { "type": "root", "style": "powerline", "powerline_symbol": "\uE0B2", "invert_powerline": true, "foreground": "#FFD700", "background": "#86BBD8", "properties": { "postfix": "", "root_icon": "⚡" } }, { "type": "session", "style": "powerline", "powerline_symbol": "\uE0B2", "invert_powerline": true, "foreground": "#ffffff", "background": "#86BBD8", "properties": { "template": "{{ .UserName }}" } }, { "type": "shell", "style": "diamond", "trailing_diamond": "\uE0B4", "invert_powerline": true, "foreground": "#ffffff", "background": "#33658A" } ] }, { "type": "prompt", "alignment": "left", "newline": true, "segments": [ { "type": "root", "style": "plain", "properties": {} }, { "type": "text", "style": "plain", "foreground": "#ffffff", "properties": { "prefix": "", "postfix": "", "text": "<#69FF94>\u276F</>" } } ] } ] }
What OS are you seeing the problem on?
Windows
Which shell are you using?
other (please specify)
Log output