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

Tooltips not rendering in WSL2 with ZSH #3396

Closed Docteur-RS closed 1 year ago

Docteur-RS commented 1 year ago

Code of Conduct

What happened?

Main prompts works well but adding the tooltip JSON to the config does nothing.

I have tested the config provided in the documentation. It doesn't work. Pressing "g" then space doesn't show the git tooltip.

I also have tested with this small config in case the documentation was wrong:

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "version": 2,
  "blocks": [
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "type": "path",
          "style": "diamond",
          "powerline_symbol": "\ue0b0",
          "foreground": "#262b44",
          "background": "#feae34",
          "leading_diamond": "\ue0b6",
          "trailing_diamond": "\ue0b0",
          "template": " {{ .Path }} ",
          "properties": {
            "style": "folder"
          }
        }
      ]
    }
  ],
  "tooltips": [
    {
      "type": "path",
      "tips": [
          "h",
          "hey"
      ],
      "style": "diamond",
      "powerline_symbol": "\ue0b0",
      "foreground": "#262b44",
      "background": "#feae34",
      "leading_diamond": "\ue0b6",
      "trailing_diamond": "\ue0b0",
      "template": " {{ .Path }} ",
      "properties": {
        "style": "folder"
      }
    }
  ]
}

Entering "hey" should print the tooltip with the path segment. It doesn't.


Using omp 13.6.0 zsh 5.8.1 (x86_64-ubuntu-linux-gnu) WSL 2 ubuntu 22.04.1

Theme

See above

What OS are you seeing the problem on?

Linux

Which shell are you using?

zsh

Log output

zsh> oh-my-posh debug

Version: 13.6.0

Segments:

ConsoleTitle(false) -   0 ms -
path(true)         -   2 ms -  xxxx 

Run duration: 3.2761ms

Cache path: /home/xxxx/.cache/oh-my-posh

Config path: /home/xxxx/.poshthemes/marcduiker.omp.json

Logs:

[DEBUG] 19:33:22.073 shell.go:Getenv:336 → NO DATA
[TRACE] 19:33:22.073 shell.go:Getenv(XDG_CACHE_HOME) - 19.6µs
[TRACE] 19:33:22.073 shell_unix.go:CachePath() - 37.2µs
[DEBUG] 19:33:22.073 shell.go:Getenv:336 → /home/xxxx/.poshthemes/marcduiker.omp.json
[TRACE] 19:33:22.073 shell.go:Getenv(POSH_THEME) - 4.8µs
[TRACE] 19:33:22.073 shell.go:resolveConfigPath() - 8.1µs
[TRACE] 19:33:22.073 shell.go:Init() - 115.5µs
[TRACE] 19:33:22.073 shell.go:Flags() - 100ns
[TRACE] 19:33:22.073 config.go:loadConfig() - 160.5µs
[TRACE] 19:33:22.073 shell.go:Flags() - 100ns
[DEBUG] 19:33:22.073 shell.go:Getenv:336 → NO DATA
[TRACE] 19:33:22.073 shell.go:Getenv(OMP_CACHE_DISABLED) - 2.3µs
[TRACE] 19:33:22.073 shell.go:Flags() - 0s
[TRACE] 19:33:22.074 shell.go:GOOS() - 200ns
[DEBUG] 19:33:22.074 shell.go:Pwd:364 → NO DATA
[TRACE] 19:33:22.074 shell.go:Pwd() - 424.9µs
[TRACE] 19:33:22.074 shell.go:GOOS() - 0s
[DEBUG] 19:33:22.074 shell.go:Pwd:344 → /mnt/c/Users/xxxx
[TRACE] 19:33:22.074 shell.go:Pwd() - 2.8µs
[DEBUG] 19:33:22.074 shell.go:Shell:581 → process name: zsh
[TRACE] 19:33:22.074 shell.go:Shell() - 299.2µs
[TRACE] 19:33:22.074 shell.go:Shell() - 0s
[TRACE] 19:33:22.074 shell.go:GOOS() - 0s
[TRACE] 19:33:22.074 shell.go:PathSeparator() - 0s
[TRACE] 19:33:22.074 shell.go:GOOS() - 0s
[TRACE] 19:33:22.074 shell.go:GOOS() - 0s
[TRACE] 19:33:22.074 shell.go:GOOS() - 100ns
[TRACE] 19:33:22.074 shell.go:GOOS() - 100ns
[TRACE] 19:33:22.074 shell.go:PathSeparator() - 0s
[TRACE] 19:33:22.074 shell.go:PathSeparator() - 0s
[TRACE] 19:33:22.074 shell.go:GOOS() - 100ns
[TRACE] 19:33:22.074 shell.go:GOOS() - 0s
[TRACE] 19:33:22.074 shell.go:PathSeparator() - 0s
[TRACE] 19:33:22.074 shell.go:GOOS() - 0s
[TRACE] 19:33:22.074 shell.go:GOOS() - 0s
[TRACE] 19:33:22.074 shell.go:PathSeparator() - 100ns
[TRACE] 19:33:22.074 shell.go:GOOS() - 0s
[TRACE] 19:33:22.074 shell.go:GOOS() - 0s
[TRACE] 19:33:22.074 shell.go:PathSeparator() - 100ns
[TRACE] 19:33:22.074 shell.go:GOOS() - 0s
[TRACE] 19:33:22.074 shell.go:GOOS() - 0s
[TRACE] 19:33:22.074 shell.go:GOOS() - 0s
[TRACE] 19:33:22.074 shell.go:GOOS() - 0s
[TRACE] 19:33:22.074 shell.go:GOOS() - 0s
[TRACE] 19:33:22.074 shell.go:GOOS() - 0s
[TRACE] 19:33:22.074 shell.go:GOOS() - 100ns
[TRACE] 19:33:22.074 shell.go:GOOS() - 0s
[TRACE] 19:33:22.074 shell.go:GOOS() - 0s
[TRACE] 19:33:22.074 shell.go:PathSeparator() - 0s
[TRACE] 19:33:22.074 shell.go:PathSeparator() - 100ns
[DEBUG] 19:33:22.074 shell.go:Pwd:344 → /mnt/c/Users/xxxx
[TRACE] 19:33:22.074 shell.go:Pwd() - 4.7µs
[DEBUG] 19:33:22.074 shell.go:Getenv:336 → Ubuntu-22.04
[TRACE] 19:33:22.074 shell.go:Getenv(WSL_DISTRO_NAME) - 2.4µs
[TRACE] 19:33:22.074 shell_unix.go:IsWsl() - 4.5µs
[DEBUG] 19:33:22.076 shell.go:RunCommand:515 → C:/Users/xxxx
[TRACE] 19:33:22.076 shell.go:RunCommand(wslpath -m /mnt/c/Users/xxxx) - 1.6148ms
[TRACE] 19:33:22.076 shell.go:StackCount() - 200ns
[TRACE] 19:33:22.076 shell_unix.go:DirIsWritable(/mnt/c/Users/xxxx) -
 8.3µs
[TRACE] 19:33:22.076 shell_unix.go:Root() - 700ns
[TRACE] 19:33:22.076 shell.go:Shell() - 300ns
[TRACE] 19:33:22.076 shell.go:ErrorCode() - 100ns
[DEBUG] 19:33:22.076 shell.go:Getenv:336 → Ubuntu-22.04
[TRACE] 19:33:22.076 shell.go:Getenv(WSL_DISTRO_NAME) - 5µs
[TRACE] 19:33:22.076 shell_unix.go:IsWsl() - 8.6µs
[DEBUG] 19:33:22.076 shell.go:Pwd:344 → /mnt/c/Users/xxxxxxxxx
[TRACE] 19:33:22.076 shell.go:Pwd() - 6.3µs
[TRACE] 19:33:22.076 shell.go:GOOS() - 100ns
[TRACE] 19:33:22.076 shell.go:GOOS() - 100ns
[TRACE] 19:33:22.076 shell.go:GOOS() - 0s
[TRACE] 19:33:22.076 shell.go:GOOS() - 0s
[TRACE] 19:33:22.076 shell.go:GOOS() - 0s
[TRACE] 19:33:22.076 shell.go:GOOS() - 0s
[TRACE] 19:33:22.076 shell.go:GOOS() - 0s
[TRACE] 19:33:22.076 shell.go:GOOS() - 0s
[TRACE] 19:33:22.076 shell.go:GOOS() - 0s
[TRACE] 19:33:22.076 shell.go:GOOS() - 100ns
[DEBUG] 19:33:22.076 shell.go:User:485 → xxxx
[TRACE] 19:33:22.076 shell.go:User() - 3.9µs
[DEBUG] 19:33:22.076 shell.go:Host:497 → LFR050587
[TRACE] 19:33:22.076 shell.go:Host() - 3.8µs
[TRACE] 19:33:22.076 shell.go:GOOS() - 0s
[TRACE] 19:33:22.076 shell.go:TemplateCache() - 79.9µs
[TRACE] 19:33:22.076 shell.go:TemplateCache() - 200ns
[TRACE] 19:33:22.076 shell.go:Shell() - 100ns
[DEBUG] 19:33:22.076 shell.go:Getenv:336 → NO DATA
[TRACE] 19:33:22.076 shell.go:Getenv(XDG_CACHE_HOME) - 3.9µs
[TRACE] 19:33:22.076 shell_unix.go:CachePath() - 13.7µs
[TRACE] 19:33:22.076 shell.go:Flags() - 100ns
JanDeDobbeleer commented 1 year ago

@Docteur-RS this works for me using your config on the same zsh version. 9/10 something in your .zshrc is conflicting with our handler. Do you get the same behaviour when you only have the oh-my-posh init line?

Docteur-RS commented 1 year ago

@JanDeDobbeleer Thank you for checking <3

I moved the init line eval "$(oh-my-posh init zsh --config ~/.poshthemes/test.omp.json)" at the end of my zshrc and it worked ! Thx

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