JanDeDobbeleer / oh-my-posh

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

Clink: when oh-my-posh.lua is active clink.promptfilter stops working #4632

Closed romibi closed 9 months ago

romibi commented 9 months ago

Code of Conduct

What happened?

I'm not completely sure where the issue is (which tool/app) but I think its oh-my-posh.

I tried setting up clink with oh-my-posh and zoxide-clink.

Clink with oh-my-posh works fine. Clink with zoxide-clink works fine.

But as soon as both oh-my-posh as well as zoxide-clink are active zoxide-clink stopps working.

Debug output in the zoxide.lua made me realize that as soon as i have the oh-my-posh.lua the clink.promptfilter():filter() doesn't get called anymore, which is used by zoxide-clink to detect directory changes.

So I'm not sure if the error is with clink or with oh-my-posh but the zoxide-clink script seems correct. See also: https://github.com/shunsambongi/clink-zoxide/issues/6 for a workaround in the meantime.

Theme

Theme? Shouldn't matter, but a modified version of powerlevel10k_rainbow

What OS are you seeing the problem on?

Windows

Which shell are you using?

cmd

Log output

Version: 19.5.2

Shell: cmd (clink v1.6.1.c7c448)

Prompt:

╭─    ~                                                                                                        ✔ ╰─

Segments:

ConsoleTitle(true)                         -   1 ms
Os(true)                                   -   0 ms
Os(true)                                   -   0 ms
Path(true)                                 -   1 ms
Git(false)                                 -  34 ms
Node(false)                                -   0 ms
Go(false)                                  -   0 ms
Julia(false)                               -   0 ms
Python(false)                              -   0 ms
Ruby(false)                                -   0 ms
Azfunc(false)                              -   0 ms
Aws(false)                                 -   0 ms
Root(false)                                -   0 ms
Executiontime(false)                       -   0 ms
Status(true)                               -   0 ms
Text(true)                                 -   0 ms

Run duration: 63.5124ms

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

Config path: C:\Users\romibi\.oh-my-posh.json

Logs:

[DEBUG] 14:18:52.578 shell.go:Getenv:399 → NO DATA
[TRACE] 14:18:52.579 shell.go:Getenv(TERM_PROGRAM) - 1.6324ms
[DEBUG] 14:18:52.579 shell.go:Getenv:399 → C:\Users\romibi\AppData\Local
[TRACE] 14:18:52.579 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 14:18:52.579 shell_windows.go:CachePath() - 0s
[DEBUG] 14:18:52.591 shell.go:Getenv:399 → C:\Users\romibi\.oh-my-posh.json
[TRACE] 14:18:52.591 shell.go:Getenv(POSH_THEME) - 0s
[DEBUG] 14:18:52.591 shell.go:Shell:662 → no shell name provided in flags, trying to detect it
[DEBUG] 14:18:52.599 shell.go:Shell:670 → process name: cmd.exe
[TRACE] 14:18:52.600 shell.go:Shell() - 8.4385ms
[TRACE] 14:18:52.600 shell.go:resolveConfigPath() - 8.4385ms
[TRACE] 14:18:52.600 shell.go:Init() - 22.8869ms
[TRACE] 14:18:52.600 shell.go:Flags() - 0s
[TRACE] 14:18:52.602 config.go:loadConfig() - 2.1826ms
[TRACE] 14:18:52.602 shell.go:Flags() - 0s
[DEBUG] 14:18:52.602 shell.go:Getenv:399 → NO DATA
[TRACE] 14:18:52.602 shell.go:Getenv(OMP_CACHE_DISABLED) - 0s
[TRACE] 14:18:52.602 shell_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s
[TRACE] 14:18:52.602 shell.go:GOOS() - 0s
[TRACE] 14:18:52.602 shell.go:GOOS() - 0s
[TRACE] 14:18:52.602 shell.go:GOOS() - 0s
[TRACE] 14:18:52.602 shell.go:GOOS() - 0s
[TRACE] 14:18:52.602 shell.go:GOOS() - 0s
[TRACE] 14:18:52.602 shell.go:GOOS() - 0s
[TRACE] 14:18:52.602 shell.go:GOOS() - 0s
[TRACE] 14:18:52.602 shell.go:GOOS() - 0s
[TRACE] 14:18:52.602 shell.go:GOOS() - 0s
[TRACE] 14:18:52.602 shell.go:GOOS() - 0s
[TRACE] 14:18:52.602 shell.go:GOOS() - 0s
[TRACE] 14:18:52.602 shell.go:GOOS() - 0s
[TRACE] 14:18:52.602 shell.go:GOOS() - 0s
[TRACE] 14:18:52.602 shell.go:GOOS() - 0s
[TRACE] 14:18:52.602 shell.go:GOOS() - 0s
[TRACE] 14:18:52.602 shell.go:GOOS() - 0s
[TRACE] 14:18:52.602 shell.go:GOOS() - 0s
[TRACE] 14:18:52.602 shell.go:GOOS() - 0s
[TRACE] 14:18:52.602 shell.go:GOOS() - 0s
[DEBUG] 14:18:52.602 shell_windows.go:WindowsRegistryKeyValue:215 → ColorizationColor(DWORD): 0xC4CC8029
[TRACE] 14:18:52.603 shell.go:Shell() - 0s
[DEBUG] 14:18:52.603 shell.go:Getenv:399 → clink v1.6.1.c7c448
[TRACE] 14:18:52.603 shell.go:Getenv(POSH_SHELL_VERSION) - 0s
[DEBUG] 14:18:52.603 debug.go:PrintDebug:22 → Segment: Title
[DEBUG] 14:18:52.604 text.go:Render:70 → Rendering template: {{ .Shell }} in {{ .Folder }}
[TRACE] 14:18:52.604 shell_windows.go:Root() - 0s
[TRACE] 14:18:52.604 shell.go:Shell() - 0s
[TRACE] 14:18:52.604 shell.go:StatusCodes() - 0s
[TRACE] 14:18:52.604 shell_windows.go:IsWsl() - 0s
[DEBUG] 14:18:52.604 shell.go:TemplateCache:843 → environment: [<snipped for privacy reasons, can dm if needed>]
[TRACE] 14:18:52.604 shell.go:GOOS() - 0s
[DEBUG] 14:18:52.604 shell.go:Pwd:429 → C:\Users\romibi
[TRACE] 14:18:52.604 shell.go:Pwd() - 504.1µs
[DEBUG] 14:18:52.604 shell_windows.go:56 → C:\Users\romibi
[TRACE] 14:18:52.604 shell.go:GOOS() - 0s
[TRACE] 14:18:52.604 shell.go:GOOS() - 0s
[TRACE] 14:18:52.604 shell.go:GOOS() - 0s
[TRACE] 14:18:52.604 shell.go:GOOS() - 0s
[TRACE] 14:18:52.604 shell.go:GOOS() - 0s
[TRACE] 14:18:52.604 shell.go:GOOS() - 0s
[TRACE] 14:18:52.604 shell.go:GOOS() - 0s
[TRACE] 14:18:52.604 shell.go:GOOS() - 0s
[TRACE] 14:18:52.604 shell.go:GOOS() - 0s
[DEBUG] 14:18:52.604 shell.go:User:564 → romibi
[TRACE] 14:18:52.604 shell.go:User() - 0s
[DEBUG] 14:18:52.605 shell.go:Host:576 → romibisPC2019
[TRACE] 14:18:52.605 shell.go:Host() - 589.6µs
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[DEBUG] 14:18:52.605 shell.go:Getenv:399 → NO DATA
[TRACE] 14:18:52.605 shell.go:Getenv(SHLVL) - 0s
[TRACE] 14:18:52.605 shell.go:TemplateCache() - 1.0937ms
[DEBUG] 14:18:52.605 shell.go:Getenv:399 → 2
[TRACE] 14:18:52.605 shell.go:Getenv(POSH_CURSOR_LINE) - 0s
[DEBUG] 14:18:52.605 shell.go:Getenv:399 → NO DATA
[TRACE] 14:18:52.605 shell.go:Getenv(POSH_CURSOR_COLUMN) - 0s
[TRACE] 14:18:52.605 shell.go:Flags() - 0s
[TRACE] 14:18:52.605 shell.go:Flags() - 0s
[TRACE] 14:18:52.605 shell.go:Shell() - 0s
[TRACE] 14:18:52.605 shell.go:Shell() - 0s
[TRACE] 14:18:52.605 shell.go:Flags() - 0s
[TRACE] 14:18:52.605 shell.go:Pwd() - 0s
[DEBUG] 14:18:52.605 shell_windows.go:56 → C:\Users\romibi
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[DEBUG] 14:18:52.605 segment.go:SetEnabled:512 → Segment: Git
[TRACE] 14:18:52.605 shell.go:Flags() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[TRACE] 14:18:52.605 shell.go:Pwd() - 0s
[DEBUG] 14:18:52.605 shell_windows.go:56 → C:\Users\romibi
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[DEBUG] 14:18:52.605 segment.go:SetEnabled:512 → Segment: Os
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[DEBUG] 14:18:52.605 properties.go:GetString:28 → 
[TRACE] 14:18:52.605 shell.go:Flags() - 0s
[TRACE] 14:18:52.605 shell.go:Flags() - 0s
[TRACE] 14:18:52.605 shell.go:Pwd() - 0s
[DEBUG] 14:18:52.605 shell_windows.go:56 → C:\Users\romibi
[TRACE] 14:18:52.605 shell.go:Pwd() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[DEBUG] 14:18:52.605 segment.go:SetEnabled:512 → Segment: Os
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[DEBUG] 14:18:52.605 properties.go:GetString:28 → 
[DEBUG] 14:18:52.605 shell_windows.go:56 → C:\Users\romibi
[TRACE] 14:18:52.605 shell.go:TemplateCache() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[DEBUG] 14:18:52.605 segment.go:SetEnabled:512 → Segment: Path
[TRACE] 14:18:52.605 shell.go:Pwd() - 0s
[TRACE] 14:18:52.605 shell.go:Shell() - 0s
[TRACE] 14:18:52.605 shell.go:Shell() - 0s
[DEBUG] 14:18:52.605 properties.go:GetBool:22 → mapped_locations_enabled: true
[DEBUG] 14:18:52.605 properties.go:GetString:28 → 
[DEBUG] 14:18:52.605 properties.go:GetString:28 → 
[DEBUG] 14:18:52.605 shell_windows.go:56 → C:\Users\romibi
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[DEBUG] 14:18:52.605 properties.go:GetString:28 → ~
[DEBUG] 14:18:52.605 properties.go:GetKeyValueMap:46 → mapped_locations: map[]
[TRACE] 14:18:52.605 shell.go:PathSeparator() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[TRACE] 14:18:52.605 shell.go:PathSeparator() - 0s
[TRACE] 14:18:52.605 shell.go:PathSeparator() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[TRACE] 14:18:52.605 shell.go:PathSeparator() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[TRACE] 14:18:52.605 shell.go:PathSeparator() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[TRACE] 14:18:52.605 shell.go:GOOS() - 0s
[TRACE] 14:18:52.605 shell.go:PathSeparator() - 0s
[TRACE] 14:18:52.605 shell.go:Pwd() - 0s
[TRACE] 14:18:52.605 shell_windows.go:IsWsl() - 0s
[TRACE] 14:18:52.605 shell.go:StackCount() - 0s
[DEBUG] 14:18:52.606 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 14:18:52.606 win32_windows.go:isWriteable:303 → current user is member of <snipped, not sure if privacy relevant>
[DEBUG] 14:18:52.606 win32_windows.go:isWriteable:311 ↓
    WRITE_DAC
    WRITE_OWNER
    SYNCHRONIZE
    DELETE
    READ_CONTROL
[DEBUG] 14:18:52.606 win32_windows.go:isWriteable:313 → user has write access
[TRACE] 14:18:52.606 shell_windows.go:DirIsWritable() - 576.6µs
[TRACE] 14:18:52.606 shell.go:TemplateCache() - 0s
[DEBUG] 14:18:52.638 shell.go:CommandPath:615 → C:\Program Files\Git\cmd\git.exe
[TRACE] 14:18:52.638 shell.go:CommandPath(git.exe) - 33.5244ms
[TRACE] 14:18:52.638 shell.go:HasCommand(git.exe) - 33.5244ms
[TRACE] 14:18:52.638 shell.go:Pwd() - 0s
[ERROR] 14:18:52.639 shell.go:HasParentFilePath:758 → CreateFile .git: The system cannot find the file specified.
[TRACE] 14:18:52.639 shell.go:HasParentFilePath(.git) - 1.1209ms
[DEBUG] 14:18:52.639 properties.go:GetBool:22 → fetch_bare_info: false
[DEBUG] 14:18:52.639 text.go:Render:70 → Rendering template: ╭─
[TRACE] 14:18:52.639 shell.go:Shell() - 0s
[DEBUG] 14:18:52.639 text.go:Render:70 → Rendering template:  {{ if .WSL }}WSL at {{ end }}{{.Icon}}
[DEBUG] 14:18:52.639 text.go:Render:70 → Rendering template:   {{ .Path }}
[TRACE] 14:18:52.639 shell.go:TemplateCache() - 0s
[TRACE] 14:18:52.639 shell.go:TemplateCache() - 0s
[TRACE] 14:18:52.639 shell.go:Shell() - 0s
[TRACE] 14:18:52.639 shell.go:Shell() - 0s
[DEBUG] 14:18:52.639 text.go:Render:70 → Rendering template: diamond
[DEBUG] 14:18:52.639 text.go:Render:70 → Rendering template: diamond
[DEBUG] 14:18:52.639 text.go:Render:70 → Rendering template: powerline
[DEBUG] 14:18:52.639 text.go:Render:70 → Rendering template: powerline
[TRACE] 14:18:52.639 shell.go:Shell() - 0s
[TRACE] 14:18:52.639 shell.go:Shell() - 0s
[TRACE] 14:18:52.639 shell.go:Shell() - 0s
[TRACE] 14:18:52.640 shell.go:Shell() - 0s
[TRACE] 14:18:52.640 shell.go:Flags() - 0s
[DEBUG] 14:18:52.640 properties.go:GetString:28 → {{ .Code }}
[TRACE] 14:18:52.640 shell.go:Pwd() - 0s
[DEBUG] 14:18:52.640 shell_windows.go:56 → C:\Users\romibi
[TRACE] 14:18:52.640 shell.go:GOOS() - 0s
[DEBUG] 14:18:52.640 segment.go:SetEnabled:512 → Segment: Status
[TRACE] 14:18:52.640 shell.go:StatusCodes() - 0s
[DEBUG] 14:18:52.640 text.go:Render:70 → Rendering template: {{ .Code }}
[TRACE] 14:18:52.640 shell.go:Flags() - 0s
[TRACE] 14:18:52.640 shell.go:Pwd() - 0s
[DEBUG] 14:18:52.640 shell_windows.go:56 → C:\Users\romibi
[TRACE] 14:18:52.640 shell.go:Flags() - 0s
[TRACE] 14:18:52.640 shell.go:Pwd() - 0s
[DEBUG] 14:18:52.640 properties.go:GetStringArray:52 → extensions: [*.rb Rakefile Gemfile]
[DEBUG] 14:18:52.640 properties.go:GetStringArray:52 → folders: []
[DEBUG] 14:18:52.640 properties.go:GetBool:22 → home_enabled: false
[DEBUG] 14:18:52.640 shell_windows.go:56 → C:\Users\romibi
[TRACE] 14:18:52.640 shell.go:Pwd() - 0s
[TRACE] 14:18:52.640 shell.go:GOOS() - 0s
[DEBUG] 14:18:52.640 segment.go:SetEnabled:512 → Segment: Go
[DEBUG] 14:18:52.640 shell_windows.go:56 → C:\Users\romibi
[TRACE] 14:18:52.640 shell.go:Flags() - 0s
[TRACE] 14:18:52.640 shell.go:Flags() - 0s
[DEBUG] 14:18:52.640 properties.go:GetStringArray:52 → extensions: [*.go go.mod]
[DEBUG] 14:18:52.640 properties.go:GetStringArray:52 → folders: []
[DEBUG] 14:18:52.640 properties.go:GetBool:22 → home_enabled: false
[DEBUG] 14:18:52.640 properties.go:GetString:28 → files
[TRACE] 14:18:52.640 shell.go:Pwd() - 0s
[TRACE] 14:18:52.640 shell.go:Pwd() - 0s
[DEBUG] 14:18:52.640 shell_windows.go:56 → C:\Users\romibi
[TRACE] 14:18:52.640 shell.go:Pwd() - 0s
[DEBUG] 14:18:52.640 shell_windows.go:56 → C:\Users\romibi
[TRACE] 14:18:52.640 shell.go:Flags() - 0s
[TRACE] 14:18:52.640 shell.go:GOOS() - 0s
[DEBUG] 14:18:52.640 segment.go:SetEnabled:512 → Segment: Python
[DEBUG] 14:18:52.640 shell_windows.go:56 → C:\Users\romibi
[TRACE] 14:18:52.640 shell.go:GOOS() - 0s
[DEBUG] 14:18:52.640 properties.go:GetStringArray:52 → extensions: [*.py *.ipynb pyproject.toml venv.bak]
[TRACE] 14:18:52.640 shell.go:Pwd() - 0s
[DEBUG] 14:18:52.640 properties.go:GetStringArray:52 → folders: [.venv venv virtualenv venv-win pyenv-win]
[DEBUG] 14:18:52.640 segment.go:SetEnabled:512 → Segment: Julia
[DEBUG] 14:18:52.640 properties.go:GetBool:22 → home_enabled: false
[TRACE] 14:18:52.640 shell.go:GOOS() - 0s
[TRACE] 14:18:52.640 shell.go:Pwd() - 0s
[DEBUG] 14:18:52.640 properties.go:GetStringArray:52 → extensions: [*.jl]
[DEBUG] 14:18:52.640 segment.go:SetEnabled:512 → Segment: Node
[DEBUG] 14:18:52.640 shell_windows.go:56 → C:\Users\romibi
[DEBUG] 14:18:52.640 properties.go:GetStringArray:52 → folders: []
[TRACE] 14:18:52.640 shell.go:Flags() - 0s
[DEBUG] 14:18:52.640 properties.go:GetBool:22 → home_enabled: false
[TRACE] 14:18:52.640 shell.go:Flags() - 0s
[DEBUG] 14:18:52.640 properties.go:GetStringArray:52 → extensions: [*.js *.ts package.json .nvmrc pnpm-workspace.yaml .pnpmfile.cjs .npmrc .vue]
[TRACE] 14:18:52.640 shell.go:Pwd() - 0s
[DEBUG] 14:18:52.640 properties.go:GetStringArray:52 → folders: []
[DEBUG] 14:18:52.640 shell_windows.go:56 → C:\Users\romibi
[DEBUG] 14:18:52.640 properties.go:GetBool:22 → home_enabled: false
[TRACE] 14:18:52.640 shell.go:Pwd() - 0s
[TRACE] 14:18:52.640 shell.go:Pwd() - 0s
[TRACE] 14:18:52.640 shell.go:Flags() - 0s
[DEBUG] 14:18:52.640 shell_windows.go:56 → C:\Users\romibi
[DEBUG] 14:18:52.640 shell_windows.go:56 → C:\Users\romibi
[TRACE] 14:18:52.640 shell.go:Pwd() - 0s
[TRACE] 14:18:52.640 shell.go:Flags() - 0s
[TRACE] 14:18:52.640 shell.go:GOOS() - 0s
[TRACE] 14:18:52.640 shell.go:Pwd() - 0s
[DEBUG] 14:18:52.640 segment.go:SetEnabled:512 → Segment: Azfunc
[TRACE] 14:18:52.640 shell.go:TemplateCache() - 0s
[DEBUG] 14:18:52.640 shell_windows.go:56 → C:\Users\romibi
[DEBUG] 14:18:52.640 properties.go:GetStringArray:52 → extensions: [host.json local.settings.json function.json]
[TRACE] 14:18:52.640 shell.go:GOOS() - 0s
[DEBUG] 14:18:52.640 shell_windows.go:56 → C:\Users\romibi
[TRACE] 14:18:52.640 shell.go:Pwd() - 0s
[DEBUG] 14:18:52.640 properties.go:GetStringArray:52 → folders: []
[DEBUG] 14:18:52.640 segment.go:SetEnabled:512 → Segment: Root
[TRACE] 14:18:52.640 shell.go:GOOS() - 0s
[DEBUG] 14:18:52.640 properties.go:GetBool:22 → home_enabled: false
[DEBUG] 14:18:52.640 properties.go:GetBool:22 → always_enabled: true
[TRACE] 14:18:52.640 shell.go:GOOS() - 0s
[TRACE] 14:18:52.640 shell.go:Pwd() - 0s
[DEBUG] 14:18:52.640 segment.go:SetEnabled:512 → Segment: Aws
[DEBUG] 14:18:52.640 shell_windows.go:56 → C:\Users\romibi
[DEBUG] 14:18:52.640 properties.go:GetBool:22 → always_enabled: false
[TRACE] 14:18:52.640 shell.go:ExecutionTime() - 0s
[DEBUG] 14:18:52.640 shell.go:Getenv:399 → NO DATA
[TRACE] 14:18:52.640 shell.go:Getenv(AWS_VAULT) - 0s
[DEBUG] 14:18:52.640 shell.go:Getenv:399 → NO DATA
[DEBUG] 14:18:52.640 properties.go:GetFloat64:34 → threshold: 500.000000
[TRACE] 14:18:52.640 shell.go:Getenv(AWS_DEFAULT_PROFILE) - 0s
[DEBUG] 14:18:52.640 shell.go:Getenv:399 → NO DATA
[TRACE] 14:18:52.640 shell.go:Getenv(AWS_PROFILE) - 0s
[DEBUG] 14:18:52.640 shell.go:Getenv:399 → NO DATA
[TRACE] 14:18:52.640 shell.go:Getenv(AWS_REGION) - 0s
[DEBUG] 14:18:52.640 shell.go:Getenv:399 → NO DATA
[TRACE] 14:18:52.640 shell_windows.go:Root() - 0s
[TRACE] 14:18:52.640 shell.go:Getenv(AWS_DEFAULT_REGION) - 0s
[DEBUG] 14:18:52.640 shell.go:Getenv:399 → NO DATA
[TRACE] 14:18:52.640 shell.go:Getenv(AWS_CONFIG_FILE) - 0s
[DEBUG] 14:18:52.640 shell_windows.go:56 → C:\Users\romibi
[ERROR] 14:18:52.640 shell.go:FileContent:534 → open C:\Users\romibi/.aws/config: The system cannot find the path specified.
[TRACE] 14:18:52.640 shell.go:FileContent(C:\Users\romibi/.aws/config) - 0s
[DEBUG] 14:18:52.640 text.go:Render:70 → Rendering template:  {{ if gt .Code 0 }}{{ reason .Code }}{{ else }}✔{{ end }}
[TRACE] 14:18:52.640 shell.go:TemplateCache() - 0s
[TRACE] 14:18:52.640 shell.go:Shell() - 0s
[DEBUG] 14:18:52.640 text.go:Render:70 → Rendering template: powerline
[DEBUG] 14:18:52.640 text.go:Render:70 → Rendering template: powerline
[DEBUG] 14:18:52.640 text.go:Render:70 → Rendering template: powerline
[DEBUG] 14:18:52.640 text.go:Render:70 → Rendering template: powerline
[DEBUG] 14:18:52.640 text.go:Render:70 → Rendering template: powerline
[DEBUG] 14:18:52.640 text.go:Render:70 → Rendering template: powerline
[DEBUG] 14:18:52.640 text.go:Render:70 → Rendering template: powerline
[DEBUG] 14:18:52.640 text.go:Render:70 → Rendering template: powerline
[DEBUG] 14:18:52.640 text.go:Render:70 → Rendering template: powerline
[DEBUG] 14:18:52.640 text.go:Render:70 → Rendering template: {{ if gt .Code 0 }}#cc2222{{ end }}
[TRACE] 14:18:52.640 shell.go:TemplateCache() - 0s
[DEBUG] 14:18:52.640 text.go:Render:70 → Rendering template: {{ if eq .Code 0 }}#13a10e{{ end }}
[TRACE] 14:18:52.640 shell.go:TemplateCache() - 0s
[DEBUG] 14:18:52.640 text.go:Render:70 → Rendering template: powerline
[TRACE] 14:18:52.640 shell.go:Shell() - 0s
[DEBUG] 14:18:52.640 shell_windows.go:TerminalWidth:109 → terminal width: 120
[TRACE] 14:18:52.640 shell_windows.go:TerminalWidth() - 0s
[TRACE] 14:18:52.640 shell.go:Shell() - 0s
[TRACE] 14:18:52.640 shell.go:Shell() - 0s
[TRACE] 14:18:52.640 shell.go:Shell() - 0s
[TRACE] 14:18:52.640 shell.go:Shell() - 0s
[TRACE] 14:18:52.640 shell.go:Flags() - 0s
[TRACE] 14:18:52.640 shell.go:Pwd() - 0s
[DEBUG] 14:18:52.640 shell_windows.go:56 → C:\Users\romibi
[TRACE] 14:18:52.640 shell.go:GOOS() - 0s
[DEBUG] 14:18:52.640 segment.go:SetEnabled:512 → Segment: Text
[TRACE] 14:18:52.640 shell.go:TemplateCache() - 0s
[DEBUG] 14:18:52.640 text.go:Render:70 → Rendering template: ╰─
[TRACE] 14:18:52.640 shell.go:Shell() - 0s
[DEBUG] 14:18:52.640 shell.go:Getenv:399 → NO DATA
[TRACE] 14:18:52.640 shell.go:Getenv(TERM_PROGRAM) - 0s
[DEBUG] 14:18:52.640 text.go:Render:70 → Rendering template: plain
[TRACE] 14:18:52.640 shell.go:Shell() - 0s
[TRACE] 14:18:52.640 shell.go:Shell() - 0s
[TRACE] 14:18:52.640 shell.go:Flags() - 0s
[TRACE] 14:18:52.640 shell.go:Shell() - 0s
[TRACE] 14:18:52.640 shell.go:Shell() - 0s
[DEBUG] 14:18:52.641 shell.go:Getenv:399 → C:\Users\romibi\AppData\Local
[TRACE] 14:18:52.641 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 14:18:52.641 shell_windows.go:CachePath() - 0s
[TRACE] 14:18:52.641 shell.go:Flags() - 0s
JanDeDobbeleer commented 9 months ago

@romibi the issue is that that z implementation doesn't set a priority when they create the prompt filter. If you use z.lua they do set this, and we can fetch their priority and adjust accordingly. Switch implementation or ask clink-zoxide to also use and set the _ZL_CLINK_PROMPT_PRIORITY variable.

romibi commented 9 months ago

@JanDeDobbeleer After quite a lot of reading up … I'm still not sure if you really can just blame clink-zoxide … I think you should reopen the issue …

Looking at clink's prompt.lua not setting a priority equals to a priority of 999? Ok, that is (compared to the used numbers I found on github) a bit a high number (low prio)… oh-my-posh seems to use priority 1 if that _ZL_CLINK_PROMPT_PRIORITY variable is not set.

Reading up further on that promptfilter functionality a filter can return a string and/or a boolean or nil. The string is used as a new prompt (and further filters) and the boolean defines if further filters should be processed.

For clink-zoxide (and i think probably also for z.lua) it shouldn't matter if it comes before or after oh-my-posh. So why is it that oh-my-posh prevents that? I can't seem to find where the boolean false is coming from and i'm not too familiar with lua.

Also, if I understand the code in z.lua correctly, it doesn't SET the _ZL_CLINK_PROMPT_PRIORITY variable but uses the value from it if it is set. So (i think) if you don't change/set it, oh-my-posh would still prevent z.lua from working (I haven't tested it). and _ZL_ seems to be the prefix for z.lua's config environment variables. So I'm not sure if it would be correct to set that variable from clink-zoxide.

So yea … I can just modify the clink-zoxide script to use prio 0 (or some negative value) … And maybe I'll make a PR to clink-zoxide to make the prio configurable … But I think oh-my-posh should be improved in this regard as well (allowing further filtering/configuratility separate from z.lua) …

JanDeDobbeleer commented 9 months ago

@romibi let's ask someone who knows instead of theorizing over something we're not familiar with.

@chrisant996 care to shed some light on the situation?

chrisant996 commented 9 months ago

The problem is in clink-zoxide.

It doesn't specify any priority. Which gives it an extremely low priority. In other words, there's a good chance it won't get to run at all. It should specify 0 or lower (negative).

For clink-zoxide (and i think probably also for z.lua) it shouldn't matter if it comes before or after oh-my-posh. So why is it that oh-my-posh prevents that? I can't seem to find where the boolean false is coming from and i'm not too familiar with lua.

No, that's incorrect. Oh-my-posh has to tell Clink to stop running other prompt filters. Otherwise starship or clink-flex-prompt or cmder-powerline or cmder's prompt filter or other personal custom prompt filters would also run, and then you'd get multiple prompts all showing at the same time, jumbled together in strange ways.

The bug is primarily in clink-zoxide, by not specifying a priority at all, and simultaneously expecting its prompt filter to be guaranteed to run.

And the bug is secondarily in the Clink documentation for Customizing the Prompt and clink.promptfilter(), for not calling out in more detail why scripts want to return false and stop further prompt filters from running, and the fact that stopping prompt filters from running ... means they don't run. Sorry, it didn't occur to me (or to Martin, apparently) that that needed to be emphasized.

Oh-my-posh shouldn't change what it's doing, nor its priority value. However, it could potentially be reasonable to add a way for a user to override its promptfilter priority (similar to how clink-zoxide provides a way).

z.lua has a similar problem as clink-zoxide, because its default priority is 99. Its default priority should be 0 or less.

romibi commented 9 months ago

… add a way for a user to override its promptfilter priority (similar to how clink-zoxide provides a way).

you mean z.lua.

Thank you for your explanation. I'll probably make a Pull Request to clink-zoxide for configurability. Locally I've already changed it in the lua to 0.

chrisant996 commented 9 months ago

And personally, I'd recommend something like:

In modern versions of Clink, clink.onbeginedit() is what both z.lua and clink-zoxide really want. But they're old enough that they predate the existence of clink.onbeginedit, and at the time clink.promptfilter was the only way. But 0 or negative was always the right priority to specify.

chrisant996 commented 9 months ago

For clink-zoxide (and i think probably also for z.lua) it shouldn't matter if it comes before or after oh-my-posh. So why is it that oh-my-posh prevents that? I can't seem to find where the boolean false is coming from and i'm not too familiar with lua.

It's coming from the right-side prompt filters:

https://github.com/JanDeDobbeleer/oh-my-posh/blob/024d8e85258f3aa75d1bfd26f83152609b0e32dc/src/shell/scripts/omp.lua#L260-L265

and

https://github.com/JanDeDobbeleer/oh-my-posh/blob/024d8e85258f3aa75d1bfd26f83152609b0e32dc/src/shell/scripts/omp.lua#L274-L276

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