oh-my-posh: oh-my-posh on WSL significantly slow

Code of Conduct

  • I agree to follow this project’s Code of Conduct

What happened?

After the update to v8.3.2, oh-my-posh has significantly slowed down on WSL (~10 ms to ~200 ms). On powershell it seems to be doing fine. The debug logs don’t show anything interesting I guess, but still, I don’t know why this is happening.

Theme

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "blocks": [
    {
      "alignment": "right",
      "newline": true,
      "horizontal_offset": 1,
      "segments": [
        {
          "foreground": "#FFD54F",
          "properties": {
            "text": "\uf2dd"
          },
          "style": "plain",
          "template": "\uf0e7 ",
          "type": "root"
        },
        {
          "foreground": "gray",
          "leading_diamond": "\ue0b6",
          "properties": {
            "threshold": 10
          },
          "style": "plain",
          "template": "\uf64f {{.FormattedMs}} ",
          "type": "executiontime"
        },
        {
          "properties": {
            "branch_icon": "\uf7a1 ",
            "fetch_stash_count": true,
            "fetch_status": false
          },
          "style": "plain",
          "template": "<#ffffff>on</> {{ .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}} \uf692 {{ .StashCount }}{{ end }}{{ if gt .WorktreeCount 0}} \uf1bb {{ .WorktreeCount }}{{ end }} ",
          "type": "git"
        },
        {
          "foreground": "#9E7DFF",
          "properties": {
            "display_mode": "context"
          },
          "style": "plain",
          "template": "\ue606 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ end }}",
          "type": "python"
        },
        {
          "foreground": "#7FD5EA",
          "style": "plain",
          "template": "\ufcd1 {{ if .Error }}{{ .Error }}{{ else }}{{ end }}",
          "type": "go"
        },
        {
          "foreground": "#98C379",
          "style": "plain",
          "template": "\ue718 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}",
          "type": "node"
        },
        {
          "foreground": "#FC5548",
          "style": "plain",
          "template": "\ue791 {{ if .Error }}{{ .Error }}{{ else }}{{ end }}",
          "type": "ruby"
        },
        {
          "foreground": "#ea2d2e",
          "style": "plain",
          "template": "\ue738 {{ if .Error }}{{ .Error }}{{ else }}{{ end }}",
          "type": "java"
        },
        {
          "foreground": "#5F7DE1",
          "style": "plain",
          "template": "\ue624 {{ if .Error }}{{ .Error }}{{ else }}{{ end }}",
          "type": "julia"
        },
        {
          "foreground": "green",
          "properties": {
            "style": "folder"
          },
          "style": "plain",
          "template": "\ufc6e {{ .Path }} ",
          "type": "path"
        }
      ],
      "type": "prompt"
    },
    {
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "foreground": "cyan",
          "style": "plain",
          "template": "{{.Icon}} ",
          "type": "os"
        },
        {
          "foreground": "cyan",
          "style": "plain",
          "template": "\u2192 ",
          "type": "text"
        }
      ],
      "type": "prompt"
    }
  ],
  "console_title_template": "{{ .Shell }} in {{ .Folder }}",
  "osc99": true,
  "version": 2
}

What OS are you seeing the problem on?

Linux

Which shell are you using?

bash

Log output

Version: 8.3.2

Segments:

ConsoleTitle(true)   -   0 ms - bash in ~
root(false)          -   0 ms -
executiontime(false) -   0 ms -
git(false)           -   0 ms -
python(false)        -   0 ms -
go(false)            -   0 ms -
node(false)          -   0 ms -
ruby(false)          -   0 ms -
java(false)          -   0 ms -
julia(false)         -   0 ms -
path(true)           -   2 ms - ﱮ ~
os(true)             -   0 ms - 
text(true)           -   0 ms - →

Run duration: 4.026702ms

Cache path: /home/amzon-ex/.cache/oh-my-posh

Config path: /home/amzon-ex/.ompthemes/minamil.omp.json

Logs:

2022/06/12 20:40:48 debug: Getenv

2022/06/12 20:40:48 Getenv duration: 10.651µs, args: XDG_CACHE_HOME
2022/06/12 20:40:48 CachePath duration: 23.074µs, args:
2022/06/12 20:40:48 debug: Getenv
/home/amzon-ex/.ompthemes/minamil.omp.json
2022/06/12 20:40:48 Getenv duration: 1.953µs, args: POSH_THEME
2022/06/12 20:40:48 resolveConfigPath duration: 3.937µs, args:
2022/06/12 20:40:48 Init duration: 81.324µs, args:
2022/06/12 20:40:48 Flags duration: 40ns, args:
2022/06/12 20:40:48 config.loadConfig duration: 331.931µs, args:
2022/06/12 20:40:48 Flags duration: 40ns, args:
2022/06/12 20:40:48 debug: Getenv

2022/06/12 20:40:48 Getenv duration: 1.383µs, args: OMP_CACHE_DISABLED
2022/06/12 20:40:48 Root duration: 481ns, args:
2022/06/12 20:40:48 Shell duration: 312.725µs, args:
2022/06/12 20:40:48 ErrorCode duration: 30ns, args:
2022/06/12 20:40:48 debug: Getenv
Ubuntu-20.04
2022/06/12 20:40:48 Getenv duration: 1.433µs, args: WSL_DISTRO_NAME
2022/06/12 20:40:48 IsWsl duration: 2.805µs, args:
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 8.717µs, args:
2022/06/12 20:40:48 PathSeparator duration: 50ns, args:
2022/06/12 20:40:48 PathSeparator duration: 20ns, args:
2022/06/12 20:40:48 debug: User
amzon-ex
2022/06/12 20:40:48 User duration: 831ns, args:
2022/06/12 20:40:48 debug: Host
minami
2022/06/12 20:40:48 Host duration: 1.893µs, args:
2022/06/12 20:40:48 GOOS duration: 30ns, args:
2022/06/12 20:40:48 TemplateCache duration: 348.923µs, args:
2022/06/12 20:40:48 Flags duration: 60ns, args:
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 691ns, args:
2022/06/12 20:40:48 GOOS duration: 20ns, args:
2022/06/12 20:40:48 Root duration: 200ns, args:
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 1.362µs, args:
2022/06/12 20:40:48 GOOS duration: 30ns, args:
2022/06/12 20:40:48 ExecutionTime duration: 40ns, args:
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 601ns, args:
2022/06/12 20:40:48 GOOS duration: 20ns, args:
2022/06/12 20:40:48 debug: Getenv
Ubuntu-20.04
2022/06/12 20:40:48 Getenv duration: 751ns, args: WSL_DISTRO_NAME
2022/06/12 20:40:48 IsWsl duration: 1.793µs, args:
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 461ns, args:
2022/06/12 20:40:48 GOOS duration: 30ns, args:
2022/06/12 20:40:48 HasCommand duration: 13.085µs, args: git
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 481ns, args:
2022/06/12 20:40:48 error: HasParentFilePath
stat /.git: no such file or directory
2022/06/12 20:40:48 HasParentFilePath duration: 5.551µs, args: .git
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 762ns, args:
2022/06/12 20:40:48 GOOS duration: 20ns, args:
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 501ns, args:
2022/06/12 20:40:48 debug: Getenv

2022/06/12 20:40:48 Getenv duration: 761ns, args: VIRTUAL_ENV
2022/06/12 20:40:48 debug: Getenv

2022/06/12 20:40:48 Getenv duration: 641ns, args: CONDA_ENV_PATH
2022/06/12 20:40:48 debug: Getenv

2022/06/12 20:40:48 Getenv duration: 651ns, args: CONDA_DEFAULT_ENV
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 481ns, args:
2022/06/12 20:40:48 PathSeparator duration: 30ns, args:
2022/06/12 20:40:48 debug: HasFiles
false
2022/06/12 20:40:48 HasFiles duration: 45.576µs, args: *.py
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 511ns, args:
2022/06/12 20:40:48 PathSeparator duration: 30ns, args:
2022/06/12 20:40:48 debug: HasFiles
false
2022/06/12 20:40:48 HasFiles duration: 28.935µs, args: *.ipynb
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 481ns, args:
2022/06/12 20:40:48 PathSeparator duration: 30ns, args:
2022/06/12 20:40:48 debug: HasFiles
false
2022/06/12 20:40:48 HasFiles duration: 3.637µs, args: pyproject.toml
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 471ns, args:
2022/06/12 20:40:48 PathSeparator duration: 30ns, args:
2022/06/12 20:40:48 debug: HasFiles
false
2022/06/12 20:40:48 HasFiles duration: 4.208µs, args: venv.bak
2022/06/12 20:40:48 debug: HasFolder
false
2022/06/12 20:40:48 HasFolder duration: 1.303µs, args: .venv
2022/06/12 20:40:48 debug: HasFolder
false
2022/06/12 20:40:48 HasFolder duration: 1.133µs, args: venv
2022/06/12 20:40:48 debug: HasFolder
false
2022/06/12 20:40:48 HasFolder duration: 1.313µs, args: virtualenv
2022/06/12 20:40:48 debug: HasFolder
false
2022/06/12 20:40:48 HasFolder duration: 1.142µs, args: env
2022/06/12 20:40:48 debug: HasFolder
false
2022/06/12 20:40:48 HasFolder duration: 1.232µs, args: venv-win
2022/06/12 20:40:48 debug: HasFolder
false
2022/06/12 20:40:48 HasFolder duration: 1.202µs, args: pyenv-win
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 671ns, args:
2022/06/12 20:40:48 GOOS duration: 21ns, args:
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 561ns, args:
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 591ns, args:
2022/06/12 20:40:48 GOOS duration: 30ns, args:
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 551ns, args:
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 581ns, args:
2022/06/12 20:40:48 GOOS duration: 30ns, args:
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 471ns, args:
2022/06/12 20:40:48 debug: Getenv

2022/06/12 20:40:48 Getenv duration: 782ns, args: JAVA_HOME
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 480ns, args:
2022/06/12 20:40:48 GOOS duration: 30ns, args:
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 471ns, args:
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 1.252µs, args:
2022/06/12 20:40:48 GOOS duration: 30ns, args:
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 481ns, args:
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 711ns, args:
2022/06/12 20:40:48 GOOS duration: 30ns, args:
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 481ns, args:
2022/06/12 20:40:48 Flags duration: 30ns, args:
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 480ns, args:
2022/06/12 20:40:48 GOOS duration: 30ns, args:
2022/06/12 20:40:48 GOOS duration: 30ns, args:
2022/06/12 20:40:48 PathSeparator duration: 31ns, args:
2022/06/12 20:40:48 PathSeparator duration: 30ns, args:
2022/06/12 20:40:48 PathSeparator duration: 20ns, args:
2022/06/12 20:40:48 PathSeparator duration: 20ns, args:
2022/06/12 20:40:48 GOOS duration: 30ns, args:
2022/06/12 20:40:48 debug: Getenv
Ubuntu-20.04
2022/06/12 20:40:48 Getenv duration: 942ns, args: WSL_DISTRO_NAME
2022/06/12 20:40:48 IsWsl duration: 2.104µs, args:
2022/06/12 20:40:48 debug: RunCommand
//wsl.localhost/Ubuntu-20.04/home/amzon-ex
2022/06/12 20:40:48 RunCommand duration: 1.952961ms, args: wslpath -m /home/amzon-ex
2022/06/12 20:40:48 StackCount duration: 51ns, args:
2022/06/12 20:40:48 DirIsWritable duration: 3.156µs, args:
2022/06/12 20:40:48 TemplateCache duration: 60ns, args:
2022/06/12 20:40:48 TemplateCache duration: 90ns, args:
2022/06/12 20:40:48 Shell duration: 60ns, args:
2022/06/12 20:40:48 Flags duration: 40ns, args:
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 3.527µs, args:
2022/06/12 20:40:48 GOOS duration: 41ns, args:
2022/06/12 20:40:48 GOOS duration: 30ns, args:
2022/06/12 20:40:48 TemplateCache duration: 30ns, args:
2022/06/12 20:40:48 TemplateCache duration: 80ns, args:
2022/06/12 20:40:48 Shell duration: 50ns, args:
2022/06/12 20:40:48 debug: Pwd
/home/amzon-ex
2022/06/12 20:40:48 Pwd duration: 5.921µs, args:
2022/06/12 20:40:48 GOOS duration: 50ns, args:
2022/06/12 20:40:48 TemplateCache duration: 30ns, args:
2022/06/12 20:40:48 TemplateCache duration: 70ns, args:
2022/06/12 20:40:48 Shell duration: 60ns, args:
2022/06/12 20:40:48 debug: Getenv

2022/06/12 20:40:48 Getenv duration: 962ns, args: XDG_CACHE_HOME
2022/06/12 20:40:48 CachePath duration: 12.083µs, args:
2022/06/12 20:40:48 Flags duration: 20ns, args:

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 31 (13 by maintainers)

Most upvoted comments

Oh I see, how silly of me. I think I didn’t know it because I frequently update my packages, and bash never showed up in the update list.

In any case, I checked. bash is already at the latest version (5.1.16(1)).

how do you update bash in WSL?

Taking Ubuntu as an example, a general way is sudo apt upgrade bash, just as in Linux.

I’ll have a look at the diff between those.

Is there any other information I can provide to help you with this? This has become a trouble. I turned off oh-my-posh to check that my prompt becomes blazing fast again, so it’s not any other issue I guess.

Linux one. I followed the linux installation instructions. which oh-my-posh points to /usr/local/bin/oh-my-posh.