JanDeDobbeleer / oh-my-posh

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

Environment not populating properly in WSL #4066

Closed j-maynard closed 1 year ago

j-maynard commented 1 year ago

Code of Conduct

What happened?

I have the following in my .zshenv to populate a MANUFACTUER Environment which I'd hoped to use in my prompt. However it doesn't matter what I do it doesn't appear in in the environment variables available to oh-my-posh. I've tried calling it other values and I've tried adding it before and after oh-my-posh initates but the same result. oh-my-posh refuses to load environment variables properly.

Minor note... This only occures on WSL. I tried it on an actual Linux install and didn't get the same issue.

export MANUFACTUER=unknown
if [[ -v WSLENV ]]; then
      export MANUFACTUER=$(powershell.exe -command "(Get-WmiObject -Class:Win32_ComputerSystem).Manufacturer")
elif [ -f /sys/devices/virtual/dmi/id/sys_vendor ]; then
      export MANUFACTUER=$(cat /sys/devices/virtual/dmi/id/sys_vendor)
fi

My Env

HOSTTYPE=x86_64
LANG=C.UTF-8
PATH=/home/jamie/.fzf/bin:/home/jamie/:/home/jamie/.cargo/bin:/home/jamie/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/PowerShell/7/:/mnt/c/Program Files (x86)/GnuPG/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/PuTTY/:/mnt/c/Users/jamie/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/jamie/AppData/Local/Programs/oh-my-posh/bin:/mnt/c/Program Files/CLI Tools:/mnt/c/Users/jamie/AppData/Local/Microsoft/WinGet/Packages/sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe/bat-v0.23.0-x86_64-pc-windows-msvc:/mnt/c/Users/jamie/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/jamie/AppData/Local/Microsoft/WinGet/Packages/MikeFarah.yq_Microsoft.Winget.Source_8wekyb3d8bbwe:/mnt/c/Program Files/Neovim/bin:/snap/bin:/home/jamie/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-StackExchange-SLASH-blackbox/bin
TERM=xterm-256color
XDG_RUNTIME_DIR=/run/user/1000/
DISPLAY=:0
WAYLAND_DISPLAY=wayland-0
PULSE_SERVER=unix:/mnt/wslg/PulseServer
WSL2_GUI_APPS_ENABLED=1
WSLENV=WT_SESSION::WT_PROFILE_ID
WT_SESSION=1b2715e6-ba1e-49fa-8ba9-d5eeacf58abd
WT_PROFILE_ID={51855cb2-8cce-5362-8f54-464b92b32386}
WSL_INTEROP=/run/WSL/395_interop
NAME=LOKI
HOME=/home/jamie
USER=jamie
LOGNAME=jamie
SHELL=/bin/zsh
WSL_DISTRO_NAME=Ubuntu
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
SHLVL=1
PWD=/home/jamie
OLDPWD=/home/jamie
DEVDIR=/home/jamie/Development
ITERM_INT=false
GPG_TTY=/dev/pts/0
GPG_KEY=9073DEB608346BA4
GNUPGHOME=/home/jamie/.gnupg
XDG_CONFIG_HOME=/home/jamie/.config
NF_SAFE=true
PC_TYPE=Razer
PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
PAGER=bat
EDITOR=nvim
XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
MANUFACTURER=Razer
FZF_DEFAULT_OPTS=--height 40% --layout=reverse --border
POSH_THEME=/home/jamie/.config/dot-files/posh/nord.omp.json
POSH_SHELL_VERSION=5.8.1
POSH_PID=396
POWERLINE_COMMAND=oh-my-posh
CONDA_PROMPT_MODIFIER=false
POSH_PROMPT_COUNT=1
NVM_DIR=/home/jamie/.nvm
──󰘁 env
HOSTTYPE=x86_64
LANG=C.UTF-8
PATH=/home/jamie/.fzf/bin:/home/jamie/:/home/jamie/.cargo/bin:/home/jamie/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/PowerShell/7/:/mnt/c/Program Files (x86)/GnuPG/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/PuTTY/:/mnt/c/Users/jamie/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/jamie/AppData/Local/Programs/oh-my-posh/bin:/mnt/c/Program Files/CLI Tools:/mnt/c/Users/jamie/AppData/Local/Microsoft/WinGet/Packages/sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe/bat-v0.23.0-x86_64-pc-windows-msvc:/mnt/c/Users/jamie/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/jamie/AppData/Local/Microsoft/WinGet/Packages/MikeFarah.yq_Microsoft.Winget.Source_8wekyb3d8bbwe:/mnt/c/Program Files/Neovim/bin:/snap/bin:/home/jamie/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-StackExchange-SLASH-blackbox/bin
TERM=xterm-256color
XDG_RUNTIME_DIR=/run/user/1000/
DISPLAY=:0
WAYLAND_DISPLAY=wayland-0
PULSE_SERVER=unix:/mnt/wslg/PulseServer
WSL2_GUI_APPS_ENABLED=1
WSLENV=WT_SESSION::WT_PROFILE_ID
WT_SESSION=1b2715e6-ba1e-49fa-8ba9-d5eeacf58abd
WT_PROFILE_ID={51855cb2-8cce-5362-8f54-464b92b32386}
WSL_INTEROP=/run/WSL/395_interop
NAME=LOKI
HOME=/home/jamie
USER=jamie
LOGNAME=jamie
SHELL=/bin/zsh
WSL_DISTRO_NAME=Ubuntu
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
SHLVL=1
PWD=/home/jamie
OLDPWD=/home/jamie
DEVDIR=/home/jamie/Development
ITERM_INT=false
GPG_TTY=/dev/pts/0
GPG_KEY=9073DEB608346BA4
GNUPGHOME=/home/jamie/.gnupg
XDG_CONFIG_HOME=/home/jamie/.config
NF_SAFE=true
PC_TYPE=Razer
PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
PAGER=bat
EDITOR=nvim
XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
MANUFACTURER=Razer
FZF_DEFAULT_OPTS=--height 40% --layout=reverse --border
POSH_THEME=/home/jamie/.config/dot-files/posh/nord.omp.json
POSH_SHELL_VERSION=5.8.1
POSH_PID=396
POWERLINE_COMMAND=oh-my-posh
CONDA_PROMPT_MODIFIER=false
POSH_PROMPT_COUNT=3
NVM_DIR=/home/jamie/.nvm

oh-my-posh environment (gather by using {{ .Env }} in a template:

 map[CONDA_PROMPT_MODIFIER:false DBUS_SESSION_BUS_ADDRESS:unix:path=/run/user/1000/bus DEVDIR:/home/jamie/Development DISPLAY::0 EDITOR:nvim FZF_DEFAULT_OPTS:--height 40% --layout=reverse --border GNUPGHOME:/home/jamie/.gnupg GPG_KEY:9073DEB608346BA4 GPG_TTY:/dev/pts/0 HOME:/home/jamie HOSTTYPE:x86_64 ITERM_INT:false LANG:C.UTF-8 LOGN NAME:LOKI NF_SAFE:true NVM_DIR:/home/jamie/.nvm OLDPWD:/home/jamie PAGER:bat PATH:/home/jamie/.fzf/bin:/home/jamie/:/home/jamie/.cargo/bin:/home/jamie/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/PowerShell/7/:/mnt/c/Program Files (x86)/GnuPG/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/PuTTY/:/mnt/c/Users/jamie/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/jamie/AppData/Local/Programs/oh-my-posh/bin:/mnt/c/Program Files/CLI Tools:/mnt/c/Users/jamie/AppData/Local/Microsoft/WinGet/Packages/sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe/bat-v0.23.0-x86_64-pc-windows-msvc:/mnt/c/Users/jamie/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/jamie/AppData/Local/Microsoft/WinGet/Packages/MikeFarah.yq_Microsoft.Winget.Source_8wekyb3d8bbwe:/mnt/c/Program Files/Neovim/bin:/snap/bin:/home/jamie/.cache/antib POSH_PID:396 POSH_PROMPT_COUNT:5 POSH_SHELL_VERSION:5.8.1 POSH_THEME:/home/jamie/.config/dot-files/posh/nord.omp.json POWERLINE_COMMAND:oh-my-posh PULSE_SERVER:unix:/mnt/wslg/PulseServer PWD:/home/jamie PYTHON_KEYRING_BACKEND:keyring.backends.null.Keyring SHELL:/bin/zsh SHLVL:1 TERM:xterm-256color USER:jamie WAYLAND_DISPLAY:wayland-0 WSL2_GUI_APPS_ENABLED:1 WSLENV:WT_SESSION::WT_PROFILE_ID WSL_DISTRO_NAME:Ubuntu WSL_INTEROP:/run/WSL/395_interop WT_PROFILE_ID:{51855cb2-8cce-5362-8f54-464b92b32386} WT_SESSION:1b2715e6-ba1e-49fa-8ba9-d5eeacf58abd XDG_CONFIG_HOME:/home/jamie/.config XDG_DATA_DIRS:/usr/local/share:/usr/share:/var/lib/snapd/desktop XDG_RUNTIME_DIR:/run/user/1000/ _:/home/jamie/.local/bin/oh-my-posh]

Theme

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "version": 2,
  "blocks": [
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "type": "os",
          "style": "diamond",
          "foreground": "#D8DEE9",
          "background": "#434C5E",
          "leading_diamond": "<#5E81AC,transparent>\u256d\u2500</>\ue0b6",
          "trailing_diamond": "<#434C6A,transparent>\ue0b4",
          "template": " {{ if .WSL }}\uf17a WSL{{ end }} "
        },
        {
          "type": "os",
          "style": "diamond",
          "foreground": "#D8DEE9",
          "background": "#5E81AC",
          "leading_diamond": "\u2500\ue0b6",
          "trailing_diamond": "<#5E81AC,transparent>\ue0b0",
          "template": " {{ if .WSL }}{{.Icon}}  {{ end }}",
          "properties": {
            "macos": "\udb80\udc36"
          }
        },
        {
          "type": "os",
          "style": "diamond",
          "foreground": "#D8DEE9",
          "background": "#5E81AC",
          "leading_diamond": "\u256d\u2500\ue0b6",
          "trailing_diamond": "<#5E81AC,transparent>\ue0b0",
          "template": " {{ if not .WSL }}{{.Icon}} {{ end }}",
          "properties": {
            "macos": "\udb80\udc36"
          }
        },
        {
          "type": "command",
          "style": "diamond",
          "foreground": "#2E3440",
          "background": "#81A1C1",
          "trailing_diamond": "<#81A1C1,transparent>\ue0b0",
          "template": "<transparent,#81A1C1>\ue0b0</> \uf4bc  {{ .Output }} ",
          "properties": {
            "command": "uname -m"
          }
        },
        {
          "type": "shell",
          "style": "diamond",
          "foreground": "#2E3440",
          "background": "#88C0D0",
          "trailing_diamond": "<#88C0D0,transparent>\ue0b0",
          "template": "<transparent,#88C0D0>\ue0b0</> \ue795 {{ .Name }} "
        },
        {
          "type": "session",
          "style": "diamond",
          "foreground": "#2E3440",
          "background": "#8FBCBB",
          "trailing_diamond": "<#8FBCBB,transparent>\ue0b0",
          "template": "<transparent,#8FBCBB>\ue0b0</> {{ if eq .UserName \"jamie\" }}\udb81\ude8c{{ else }}\uf007{{ end }} {{ if .SSHSession }}\udb80\udf18 {{ end }}{{ .UserName }} "
        },
        {
          "type": "root",
          "style": "diamond",
          "foreground": "#D8DEE9",
          "background": "#BF616A",
          "trailing_diamond": "\ue0b0",
          "template": "<transparent>\ue0b0</> \uf292 "
        },
        {
          "type": "path",
          "style": "powerline",
          "foreground": "#2E3440",
          "background": "#EBCB8B",
          "trailing_diamond": "\ue0b0",
          "template": "<transparent>\ue0b0</> \uf07c  {{ .Path }}  <background,transparent>\ue0b0</>",
          "properties": {
            "folder_icon": " \uf07c ",
            "home_icon": "\uf015",
            "style": "folder"
          }
        },
        {
          "type": "os",
          "style": "diamond",
          "foreground": "#2E3440",
          "background": "#A3BE8C",
          "trailing_diamond": "\ue0b4",
          "template": "{{ if eq .Env.MANUFACTURER \"Razer\" }}Razer{{end}} {{.Env}} <transparent>\ue0b0</> {{.Icon}}",
          "properties": {
            "linux": "\udb85\udd0e",
            "macos": "\udb85\udd0e",
            "ubuntu": "\udb85\udd0e",
            "windows": "\udb85\udd0e"
          }
        },
        {
          "type": "os",
          "style": "diamond",
          "foreground": "#BF616A",
          "background": "#d8dee9",
          "trailing_diamond": "\ue0b4",
          "template": "{{if .WSL}}<transparent>\ue0b0</> {{.Icon}} {{end}}",
          "properties": {
            "linux": "\uf1d0",
            "macos": "\uf1d0",
            "ubuntu": "\uf1d0",
            "windows": "\uf1d0"
          }
        },
        {
          "type": "git",
          "style": "diamond",
          "foreground": "#2E3440",
          "background": "#8FBCBB",
          "leading_diamond": "<#8FBCBB,transparent>\u2500\u2500\ue0b6</>",
          "trailing_diamond": "\ue0b4<#8FBCBB,transparent>\u2500\u2500</>",
          "template": " {{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }} <background,transparent>\ue0b0</><transparent>\ue0b0</> \uf044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} <background,transparent>\ue0b0</><transparent>\ue0b0</>{{ end }}{{ if .Staging.Changed }}<#ECEFF4> \uf046 {{ .Staging.String }}</>{{ end }} ",
          "properties": {
            "branch_icon": "\ue725  ",
            "fetch_status": true,
            "fetch_upstream_icon": true,
            "github_icon": "\uf113  "
          }
        }
      ]
    },
    {
      "type": "prompt",
      "alignment": "right",
      "segments": [
        {
          "type": "node",
          "style": "diamond",
          "foreground": "#ECEFF4",
          "background": "#5E81AC",
          "leading_diamond": "\ue0b6",
          "trailing_diamond": "\ue0b4<#8FBCBB,transparent>\u2500\u2500</>",
          "template": " \ue718 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} ",
          "properties": {
            "fetch_package_manager": true,
            "npm_icon": " <#cc3a3a>\ue5fa</> ",
            "yarn_icon": " <#348cba>\udb80\udd1b</>"
          }
        },
        {
          "type": "python",
          "style": "diamond",
          "foreground": "#ECEFF4",
          "background": "#5E81AC",
          "leading_diamond": "\ue0b6",
          "trailing_diamond": "\ue0b4<#8FBCBB,transparent>\u2500\u2500</>",
          "template": " \ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }}{{ end }} "
        },
        {
          "type": "java",
          "style": "diamond",
          "foreground": "#ECEFF4",
          "background": "#5E81AC",
          "leading_diamond": "\ue0b6",
          "trailing_diamond": "\ue0b4<#8FBCBB,transparent>\u2500\u2500</>",
          "template": " \ue738 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} "
        },
        {
          "type": "dotnet",
          "style": "diamond",
          "foreground": "#ECEFF4",
          "background": "#5E81AC",
          "leading_diamond": "\ue0b6",
          "trailing_diamond": "\ue0b4<#8FBCBB,transparent>\u2500\u2500</>",
          "template": " \ue77f {{ if .Unsupported }}\uf071{{ else }}{{ .Full }}{{ end }} "
        },
        {
          "type": "go",
          "style": "diamond",
          "foreground": "#ECEFF4",
          "background": "#5E81AC",
          "leading_diamond": "\ue0b6",
          "trailing_diamond": "\ue0b4<#8FBCBB,transparent>\u2500\u2500</>",
          "template": " \udb81\udfd3 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} "
        },
        {
          "type": "rust",
          "style": "diamond",
          "foreground": "#ECEFF4",
          "background": "#5E81AC",
          "leading_diamond": "\ue0b6",
          "trailing_diamond": "\ue0b4<#8FBCBB,transparent>\u2500\u2500</>",
          "template": " \ue7a8 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} "
        },
        {
          "type": "dart",
          "style": "diamond",
          "foreground": "#ECEFF4",
          "background": "#5E81AC",
          "leading_diamond": "\ue0b6",
          "trailing_diamond": "\ue0b4<#8FBCBB,transparent>\u2500\u2500</>",
          "template": " \ue798 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} "
        },
        {
          "type": "angular",
          "style": "diamond",
          "foreground": "#ECEFF4",
          "background": "#5E81AC",
          "leading_diamond": "\ue0b6",
          "trailing_diamond": "\ue0b4<#8FBCBB,transparent>\u2500\u2500</>",
          "template": " \ue753 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} "
        },
        {
          "type": "julia",
          "style": "diamond",
          "foreground": "#ECEFF4",
          "background": "#5E81AC",
          "leading_diamond": "\ue0b6",
          "trailing_diamond": "\ue0b4<#8FBCBB,transparent>\u2500\u2500</>",
          "template": " <#ca3c34>\ue624</> {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} "
        },
        {
          "type": "ruby",
          "style": "diamond",
          "foreground": "#ECEFF4",
          "background": "#5E81AC",
          "leading_diamond": "\ue0b6",
          "trailing_diamond": "\ue0b4<#8FBCBB,transparent>\u2500\u2500</>",
          "template": " \ue791 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} "
        },
        {
          "type": "azfunc",
          "style": "diamond",
          "foreground": "#ECEFF4",
          "background": "#5E81AC",
          "leading_diamond": "\ue0b6",
          "trailing_diamond": "\ue0b4<#8FBCBB,transparent>\u2500\u2500</>",
          "template": " \uf104<#f5bf45>\uf0e7</>\uf105 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} "
        },
        {
          "type": "aws",
          "style": "diamond",
          "foreground": "#ECEFF4",
          "background": "#5E81AC",
          "leading_diamond": "\ue0b6",
          "trailing_diamond": "\ue0b4<#8FBCBB,transparent>\u2500\u2500</>",
          "template": " \ue7ad {{.Profile}}{{if .Region}}@{{.Region}}{{end}} "
        },
        {
          "type": "kubectl",
          "style": "diamond",
          "foreground": "#ECEFF4",
          "background": "#5E81AC",
          "leading_diamond": "\ue0b6",
          "trailing_diamond": "\ue0b4",
          "template": " \udb82\udc33 {{.Context}}{{if .Namespace}} :: {{.Namespace}}{{end}} "
        },
        {
          "type": "exit",
          "style": "diamond",
          "foreground": "#2E3440",
          "background": "#A3BE8C",
          "background_templates": [
            "{{ if gt .Code 0 }}#BF616A{{ end }}"
          ],
          "leading_diamond": "\ue0b6",
          "template": "{{ if gt .Code 0 }} <#D8DEE9>\uf071  {{ .Meaning }}</>{{ else }}\uf00c{{ end }}<transparent> \ue0b2</>",
          "properties": {
            "always_enabled": true
          }
        },
        {
          "type": "executiontime",
          "style": "diamond",
          "foreground": "#2E3440",
          "background": "#EBCB8B",
          "leading_diamond": "\ue0b2",
          "template": " \udb81\udd1f{{ .FormattedMs }}\u2800<transparent>\ue0b2</>",
          "properties": {
            "style": "roundrock",
            "threshold": 0
          }
        },
        {
          "type": "battery",
          "style": "diamond",
          "invert_powerline": true,
          "foreground": "#2E3440",
          "background": "#8FBCBB",
          "background_templates": [
            "{{if eq \"Charging\" .State.String}}#D08770{{end}}",
            "{{if eq \"Discharging\" .State.String}}#EBCB8B{{end}}",
            "{{if eq \"Full\" .State.String}}#8FBCBB{{end}}"
          ],
          "leading_diamond": "\ue0b2",
          "template": " {{ if not .Error }}{{ .Icon }}{{ .Percentage }} %{{ end }}{{ .Error }} <transparent>\ue0b2</>",
          "properties": {
            "charged_icon": "\udb85\udfe6 ",
            "charging_icon": "\uf1e6 ",
            "discharging_icon": "\ue234 "
          }
        },
        {
          "type": "time",
          "style": "diamond",
          "invert_powerline": true,
          "foreground": "#2E3440",
          "background": "#88C0D0",
          "leading_diamond": "\ue0b2",
          "trailing_diamond": "\ue0b4 ",
          "template": " \udb80\udcf0 {{ .CurrentDate | date .Format }} ",
          "properties": {
            "time_format": "3:04 PM"
          }
        }
      ],
      "filler": "<#8FBCBB,transparent>\u2500</>"
    },
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "type": "text",
          "style": "plain",
          "foreground": "#5E81AC",
          "template": "\u2570\u2500"
        },
        {
          "type": "exit",
          "style": "plain",
          "foreground": "#88C0D0",
          "foreground_templates": [
            "{{ if gt .Code 0 }}#BF616A{{ end }}"
          ],
          "template": "\ue285\udb81\ude01 ",
          "properties": {
            "always_enabled": true
          }
        }
      ],
      "newline": true
    }
  ],
  "transient_prompt": {
    "foreground": "#88C0D0",
    "background": "transparent",
    "template": "\u2500\u2500\ue285\udb81\ude01 "
  }
}

What OS are you seeing the problem on?

Windows, Linux

Which shell are you using?

bash, zsh

Log output

Version: 17.11.2

Shell: zsh (5.8.1)

Segments:

ConsoleTitle(false)                        -   0 ms - 
os(true)                                   -   0 ms - Ôò¡Ôöǯé ´à║ WSL 
os(true)                                   -   0 ms - ¯é┤Ôöǯé ´îø  
os(false)                                  -   0 ms - 
command(true)                              -   0 ms - ¯é░¯é░ ´Æ╝  x86_64 
shell(true)                                -   0 ms - ¯é░¯é░ ¯×ò zsh 
session(true)                              -   0 ms - ¯é░¯é░ ¾░Üî jamie 
root(false)                                -   0 ms - 
path(true)                                 -   0 ms - ¯é░¯é░ ´ü╝  ´Çò  ¯é░
os(true)                                   -   0 ms -  map[CONDA_PROMPT_MODIFIER:false DBUS_SESSION_BUS_ADDRESS:unix:path=/run/user/1000/bus DEVDIR:/home/jamie/Development DISPLAY::0 EDITOR:nvim FZF_DEFAULT_OPTS:--height 40%% --layout=reverse --border GNUPGHOME:/home/jamie/.gnupg GPG_KEY:9073DEB608346BA4 GPG_TTY:/dev/pts/0 HOME:/home/jamie HOSTTYPE:x86_64 ITERM_INT:false LANG:C.UTF-8 LOGNAME:jamie MANUFACTURER:Razer
 NAME:LOKI NF_SAFE:true NVM_DIR:/home/jamie/.nvm OLDPWD:/home/jamie PAGER:bat PATH:/home/jamie/.fzf/bin:/home/jamie/:/home/jamie/.cargo/bin:/home/jamie/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/PowerShell/7/:/mnt/c/Program Files (x86)/GnuPG/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/PuTTY/:/mnt/c/Users/jamie/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/jamie/AppData/Local/Programs/oh-my-posh/bin:/mnt/c/Program Files/CLI Tools:/mnt/c/Users/jamie/AppData/Local/Microsoft/WinGet/Packages/sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe/bat-v0.23.0-x86_64-pc-windows-msvc:/mnt/c/Users/jamie/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/jamie/AppData/Local/Microsoft/WinGet/Packages/MikeFarah.yq_Microsoft.Winget.Source_8wekyb3d8bbwe:/mnt/c/Program Files/Neovim/bin:/snap/bin:/home/jamie/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-StackExchange-SLASH-blackbox/bin PCT:HP PC_TYPE:Razer
 POSH_PID:396 POSH_PROMPT_COUNT:8 POSH_SHELL_VERSION:5.8.1 POSH_THEME:/home/jamie/.config/dot-files/posh/nord.omp.json POWERLINE_COMMAND:oh-my-posh PULSE_SERVER:unix:/mnt/wslg/PulseServer PWD:/home/jamie PYTHON_KEYRING_BACKEND:keyring.backends.null.Keyring SHELL:/bin/zsh SHLVL:1 TERM:xterm-256color USER:jamie WAYLAND_DISPLAY:wayland-0 WSL2_GUI_APPS_ENABLED:1 WSLENV:WT_SESSION::WT_PROFILE_ID WSL_DISTRO_NAME:Ubuntu WSL_INTEROP:/run/WSL/395_interop WT_PROFILE_ID:{51855cb2-8cce-5362-8f54-464b92b32386} WT_SESSION:1b2715e6-ba1e-49fa-8ba9-d5eeacf58abd XDG_CONFIG_HOME:/home/jamie/.config XDG_DATA_DIRS:/usr/local/share:/usr/share:/var/lib/snapd/desktop XDG_RUNTIME_DIR:/run/user/1000/ _:/home/jamie/.local/bin/oh-my-posh] ¯é░ ¾▒öÄ
os(true)                                   -   0 ms - ¯é┤¯é░ ´çÉ 
git(false)                                 -   0 ms - 
node(false)                                -   0 ms - 
python(false)                              -   0 ms - 
java(false)                                -   0 ms - 
dotnet(false)                              -   0 ms - 
go(false)                                  -   0 ms - 
rust(false)                                -   0 ms - 
dart(false)                                -   0 ms - 
angular(false)                             -   0 ms - 
julia(false)                               -   0 ms - 
ruby(false)                                -   0 ms - 
azfunc(false)                              -   0 ms - 
aws(false)                                 -   0 ms - 
kubectl(false)                             - 127 ms - 
exit(true)                                 -   0 ms - ¯é´Çî ¯é▓
executiontime(true)                        -   0 ms - ¯é▓ ¾░öƒ0msÔáǯé▓
battery(true)                              -   0 ms - ¯é▓ 79 %% ¯é▓
time(true)                                 -   0 ms - ¯é▓ ¾░â░ 1:40 AM 
text(true)                                 -   0 ms - Ôò░ÔöÇ
exit(true)                                 -   0 ms - ¯èà¾░ÿü 

Run duration: 136.29329ms

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

Config path: /home/jamie/.config/dot-files/posh/nord.omp.json

Logs:

[DEBUG] 01:40:20.124 shell.go:Getenv:397  NO DATA
[TRACE] 01:40:20.124 shell.go:Getenv(TERM_PROGRAM) - 10.834┬Ás
[DEBUG] 01:40:20.124 shell.go:Getenv:397  NO DATA
[TRACE] 01:40:20.124 shell.go:Getenv(XDG_CACHE_HOME) - 1.291┬Ás
[TRACE] 01:40:20.124 shell_unix.go:CachePath() - 6.565┬Ás
[DEBUG] 01:40:20.124 shell.go:Getenv:397  /home/jamie/.config/dot-files/posh/nord.omp.json
[TRACE] 01:40:20.124 shell.go:Getenv(POSH_THEME) - 1.737┬Ás
[DEBUG] 01:40:20.124 shell_unix.go:Platform:71  ubuntu
[TRACE] 01:40:20.124 shell.go:resolveConfigPath() - 5.47┬Ás
[TRACE] 01:40:20.124 shell.go:Init() - 146.315┬Ás
[TRACE] 01:40:20.124 shell.go:Flags() - 43ns
[TRACE] 01:40:20.125 config.go:loadConfig() - 772.32┬Ás
[TRACE] 01:40:20.125 shell.go:Flags() - 51ns
[DEBUG] 01:40:20.125 shell.go:Getenv:397  NO DATA
[TRACE] 01:40:20.125 shell.go:Getenv(OMP_CACHE_DISABLED) - 1.874┬Ás
[DEBUG] 01:40:20.127 shell.go:Shell:644  process name: zsh
[TRACE] 01:40:20.127 shell.go:Shell() - 1.79736ms
[DEBUG] 01:40:20.127 shell.go:Getenv:397  5.8.1
[TRACE] 01:40:20.127 shell.go:Getenv(POSH_SHELL_VERSION) - 1.877┬Ás
[DEBUG] 01:40:20.127 debug.go:PrintDebug:23  Segment: Title
[TRACE] 01:40:20.127 shell.go:Flags() - 44ns
[DEBUG] 01:40:20.127 block.go:Debug:280  Segment: os
[TRACE] 01:40:20.127 shell.go:GOOS() - 51ns
[DEBUG] 01:40:20.127 shell.go:Pwd:427  /home/jamie
[TRACE] 01:40:20.127 shell.go:Pwd() - 6.224┬Ás
[TRACE] 01:40:20.127 shell.go:GOOS() - 25ns
[TRACE] 01:40:20.127 shell.go:GOOS() - 18ns
[DEBUG] 01:40:20.127 shell_unix.go:Platform:71  ubuntu
[DEBUG] 01:40:20.127 properties.go:GetBool:22  display_distro_name: false
[DEBUG] 01:40:20.127 properties.go:GetString:28 ÔåÆ ´îø
[TRACE] 01:40:20.127 shell_unix.go:Root() - 135ns
[TRACE] 01:40:20.127 shell.go:Shell() - 41ns
[TRACE] 01:40:20.127 shell.go:ErrorCode() - 32ns
[DEBUG] 01:40:20.127 shell_unix.go:IsWsl:35  true
[TRACE] 01:40:20.127 shell_unix.go:IsWsl() - 1.65┬Ás
[TRACE] 01:40:20.127 shell.go:Pwd() - 55ns
[TRACE] 01:40:20.127 shell.go:GOOS() - 18ns
[TRACE] 01:40:20.127 shell.go:GOOS() - 30ns
[TRACE] 01:40:20.127 shell.go:GOOS() - 18ns
[TRACE] 01:40:20.127 shell.go:GOOS() - 18ns
[TRACE] 01:40:20.127 shell.go:GOOS() - 17ns
[TRACE] 01:40:20.127 shell.go:GOOS() - 17ns
[TRACE] 01:40:20.127 shell.go:GOOS() - 19ns
[DEBUG] 01:40:20.127 shell.go:User:548  jamie
[TRACE] 01:40:20.127 shell.go:User() - 1.564┬Ás
[DEBUG] 01:40:20.127 shell.go:Host:560  LOKI
[TRACE] 01:40:20.127 shell.go:Host() - 2.079┬Ás
[TRACE] 01:40:20.127 shell.go:GOOS() - 19ns
[DEBUG] 01:40:20.127 shell_unix.go:Platform:71  ubuntu
[DEBUG] 01:40:20.127 shell.go:Getenv:397  1
[TRACE] 01:40:20.127 shell.go:Getenv(SHLVL) - 1.526┬Ás
[TRACE] 01:40:20.127 shell.go:TemplateCache() - 43.582┬Ás
[TRACE] 01:40:20.127 shell.go:TemplateCache() - 329ns
[TRACE] 01:40:20.127 shell.go:Shell() - 107ns
[DEBUG] 01:40:20.127 block.go:Debug:280  Segment: os
[TRACE] 01:40:20.127 shell.go:Pwd() - 68ns
[TRACE] 01:40:20.127 shell.go:GOOS() - 34ns
[TRACE] 01:40:20.127 shell.go:GOOS() - 29ns
[DEBUG] 01:40:20.127 shell_unix.go:Platform:71  ubuntu
[DEBUG] 01:40:20.127 properties.go:GetBool:22  display_distro_name: false
[DEBUG] 01:40:20.127 properties.go:GetString:28 ÔåÆ ´îø
[TRACE] 01:40:20.127 shell.go:TemplateCache() - 55ns
[TRACE] 01:40:20.127 shell.go:TemplateCache() - 81ns
[TRACE] 01:40:20.127 shell.go:Shell() - 37ns
[DEBUG] 01:40:20.127 block.go:Debug:280  Segment: os
[TRACE] 01:40:20.127 shell.go:Pwd() - 56ns
[TRACE] 01:40:20.127 shell.go:GOOS() - 32ns
[TRACE] 01:40:20.127 shell.go:GOOS() - 20ns
[DEBUG] 01:40:20.127 shell_unix.go:Platform:71  ubuntu
[DEBUG] 01:40:20.127 properties.go:GetBool:22  display_distro_name: false
[DEBUG] 01:40:20.127 properties.go:GetString:28 ÔåÆ ´îø
[TRACE] 01:40:20.127 shell.go:TemplateCache() - 49ns
[TRACE] 01:40:20.127 shell.go:TemplateCache() - 79ns
[TRACE] 01:40:20.127 shell.go:TemplateCache() - 37ns
[TRACE] 01:40:20.127 shell.go:Shell() - 31ns
[DEBUG] 01:40:20.127 block.go:Debug:280  Segment: command
[TRACE] 01:40:20.127 shell.go:Pwd() - 47ns
[TRACE] 01:40:20.127 shell.go:GOOS() - 31ns
[DEBUG] 01:40:20.127 properties.go:GetString:28  bash
[DEBUG] 01:40:20.127 shell.go:CommandPath:599  /usr/bin/bash
[TRACE] 01:40:20.127 shell.go:CommandPath(bash) - 17.96┬Ás
[TRACE] 01:40:20.127 shell.go:HasCommand(bash) - 19.639┬Ás
[DEBUG] 01:40:20.127 properties.go:GetString:28  uname -m
[DEBUG] 01:40:20.128 shell.go:RunCommand:578  x86_64
[TRACE] 01:40:20.128 shell.go:RunCommand(bash -c uname -m) - 771.911┬Ás
[TRACE] 01:40:20.128 shell.go:RunShellCommand() - 774.209┬Ás
[TRACE] 01:40:20.128 shell.go:TemplateCache() - 127ns
[TRACE] 01:40:20.128 shell.go:TemplateCache() - 89ns
[TRACE] 01:40:20.128 shell.go:Shell() - 90ns
[DEBUG] 01:40:20.128 block.go:Debug:280  Segment: shell
[TRACE] 01:40:20.128 shell.go:Pwd() - 62ns
[TRACE] 01:40:20.128 shell.go:GOOS() - 31ns
[DEBUG] 01:40:20.128 properties.go:GetKeyValueMap:46  mapped_shell_names: map[]
[TRACE] 01:40:20.128 shell.go:Shell() - 29ns
[TRACE] 01:40:20.128 shell.go:Flags() - 31ns
[TRACE] 01:40:20.128 shell.go:TemplateCache() - 61ns
[TRACE] 01:40:20.128 shell.go:TemplateCache() - 79ns
[TRACE] 01:40:20.128 shell.go:Shell() - 41ns
[DEBUG] 01:40:20.129 block.go:Debug:280  Segment: session
[TRACE] 01:40:20.129 shell.go:Pwd() - 60ns
[TRACE] 01:40:20.129 shell.go:GOOS() - 32ns
[DEBUG] 01:40:20.129 shell.go:Getenv:397  NO DATA
[TRACE] 01:40:20.129 shell.go:Getenv(SSH_CONNECTION) - 2.277┬Ás
[DEBUG] 01:40:20.129 shell.go:Getenv:397  NO DATA
[TRACE] 01:40:20.129 shell.go:Getenv(SSH_CLIENT) - 920ns
[TRACE] 01:40:20.129 shell.go:TemplateCache() - 47ns
[TRACE] 01:40:20.129 shell.go:TemplateCache() - 93ns
[TRACE] 01:40:20.129 shell.go:Shell() - 61ns
[DEBUG] 01:40:20.129 block.go:Debug:280  Segment: root
[TRACE] 01:40:20.129 shell.go:Pwd() - 52ns
[TRACE] 01:40:20.129 shell.go:GOOS() - 31ns
[TRACE] 01:40:20.129 shell_unix.go:Root() - 242ns
[DEBUG] 01:40:20.129 block.go:Debug:280  Segment: path
[TRACE] 01:40:20.129 shell.go:Pwd() - 25ns
[TRACE] 01:40:20.129 shell.go:GOOS() - 28ns
[TRACE] 01:40:20.129 shell.go:Pwd() - 26ns
[TRACE] 01:40:20.129 shell.go:Shell() - 29ns
[TRACE] 01:40:20.129 shell.go:Shell() - 20ns
[DEBUG] 01:40:20.129 properties.go:GetBool:22  mapped_locations_enabled: true
[DEBUG] 01:40:20.129 properties.go:GetString:28 ÔåÆ ´Çô
[DEBUG] 01:40:20.129 properties.go:GetString:28 ÔåÆ ´Çô
[TRACE] 01:40:20.129 shell.go:GOOS() - 17ns
[DEBUG] 01:40:20.129 properties.go:GetString:28 ÔåÆ ´Çò
[DEBUG] 01:40:20.129 properties.go:GetKeyValueMap:46  mapped_locations: map[]
[TRACE] 01:40:20.129 shell.go:PathSeparator() - 41ns
[TRACE] 01:40:20.129 shell.go:GOOS() - 18ns
[TRACE] 01:40:20.129 shell.go:GOOS() - 41ns
[TRACE] 01:40:20.129 shell.go:GOOS() - 17ns
[TRACE] 01:40:20.129 shell.go:GOOS() - 17ns
[TRACE] 01:40:20.129 shell.go:PathSeparator() - 27ns
[TRACE] 01:40:20.129 shell.go:PathSeparator() - 30ns
[TRACE] 01:40:20.129 shell.go:GOOS() - 65ns
[TRACE] 01:40:20.129 shell.go:GOOS() - 17ns
[TRACE] 01:40:20.129 shell.go:PathSeparator() - 29ns
[TRACE] 01:40:20.129 shell.go:GOOS() - 16ns
[TRACE] 01:40:20.129 shell.go:GOOS() - 17ns
[TRACE] 01:40:20.129 shell.go:PathSeparator() - 29ns
[TRACE] 01:40:20.129 shell.go:GOOS() - 17ns
[TRACE] 01:40:20.129 shell.go:GOOS() - 16ns
[TRACE] 01:40:20.129 shell.go:PathSeparator() - 28ns
[TRACE] 01:40:20.129 shell.go:Pwd() - 43ns
[DEBUG] 01:40:20.129 shell_unix.go:IsWsl:35  true
[TRACE] 01:40:20.129 shell_unix.go:IsWsl() - 1.514┬Ás
[DEBUG] 01:40:20.129 shell.go:RunCommand:578  //wsl.localhost/Ubuntu/home/jamie
[TRACE] 01:40:20.129 shell.go:RunCommand(wslpath -m /home/jamie) - 455.125┬Ás
[TRACE] 01:40:20.129 shell.go:StackCount() - 90ns
[TRACE] 01:40:20.129 shell_unix.go:DirIsWritable(/home/jamie) - 3.503┬Ás
[TRACE] 01:40:20.129 shell.go:TemplateCache() - 92ns
[TRACE] 01:40:20.129 shell.go:TemplateCache() - 84ns
[TRACE] 01:40:20.129 shell.go:Shell() - 72ns
[DEBUG] 01:40:20.129 block.go:Debug:280  Segment: os
[TRACE] 01:40:20.129 shell.go:Pwd() - 55ns
[TRACE] 01:40:20.129 shell.go:GOOS() - 43ns
[TRACE] 01:40:20.129 shell.go:GOOS() - 25ns
[DEBUG] 01:40:20.129 shell_unix.go:Platform:71  ubuntu
[DEBUG] 01:40:20.129 properties.go:GetBool:22  display_distro_name: false
[DEBUG] 01:40:20.129 properties.go:GetString:28 ÔåÆ ¾▒öÄ
[TRACE] 01:40:20.129 shell.go:TemplateCache() - 47ns
[TRACE] 01:40:20.129 shell.go:TemplateCache() - 79ns
[TRACE] 01:40:20.130 shell.go:Shell() - 66ns
[DEBUG] 01:40:20.130 block.go:Debug:280  Segment: os
[TRACE] 01:40:20.130 shell.go:Pwd() - 59ns
[TRACE] 01:40:20.130 shell.go:GOOS() - 31ns
[TRACE] 01:40:20.130 shell.go:GOOS() - 24ns
[DEBUG] 01:40:20.130 shell_unix.go:Platform:71  ubuntu
[DEBUG] 01:40:20.130 properties.go:GetBool:22  display_distro_name: false
[DEBUG] 01:40:20.130 properties.go:GetString:28 ÔåÆ ´çÉ
[TRACE] 01:40:20.130 shell.go:TemplateCache() - 46ns
[TRACE] 01:40:20.130 shell.go:TemplateCache() - 77ns
[TRACE] 01:40:20.130 shell.go:Shell() - 30ns
[DEBUG] 01:40:20.130 block.go:Debug:280  Segment: git
[TRACE] 01:40:20.130 shell.go:Pwd() - 45ns
[TRACE] 01:40:20.130 shell.go:GOOS() - 33ns
[DEBUG] 01:40:20.130 shell_unix.go:IsWsl:35  true
[TRACE] 01:40:20.130 shell_unix.go:IsWsl() - 1.956┬Ás
[DEBUG] 01:40:20.130 shell.go:FileContent:522 Ôåô
    5.15.90.1-microsoft-standard-WSL2

[TRACE] 01:40:20.130 shell.go:FileContent(/proc/sys/kernel/osrelease) - 30.967┬Ás
[TRACE] 01:40:20.130 shell_unix.go:IsWsl2() - 35.877┬Ás
[TRACE] 01:40:20.130 shell.go:Pwd() - 55ns
[DEBUG] 01:40:20.130 shell.go:RunCommand:578  //wsl.localhost/Ubuntu/home/jamie
[TRACE] 01:40:20.130 shell.go:RunCommand(wslpath -m /home/jamie) - 486.334┬Ás
[TRACE] 01:40:20.130 shell.go:GOOS() - 36ns
[DEBUG] 01:40:20.130 shell.go:CommandPath:599  /usr/bin/git
[TRACE] 01:40:20.130 shell.go:CommandPath(git) - 16.213┬Ás
[TRACE] 01:40:20.130 shell.go:HasCommand(git) - 17.713┬Ás
[TRACE] 01:40:20.130 shell.go:Pwd() - 70ns
[ERROR] 01:40:20.130 shell.go:HasParentFilePath:732  stat .git: no such file or directory
[TRACE] 01:40:20.130 shell.go:HasParentFilePath(.git) - 10.574┬Ás
[DEBUG] 01:40:20.130 properties.go:GetBool:22  fetch_bare_info: false
[TRACE] 01:40:20.130 shell.go:Flags() - 36ns
[DEBUG] 01:40:20.130 block.go:Debug:280  Segment: node
[TRACE] 01:40:20.130 shell.go:Pwd() - 29ns
[TRACE] 01:40:20.130 shell.go:GOOS() - 33ns
[DEBUG] 01:40:20.130 properties.go:GetStringArray:52  extensions: [*.js *.ts package.json .nvmrc pnpm-workspace.yaml .pnpmfile.cjs .npmrc .vue]
[DEBUG] 01:40:20.130 properties.go:GetStringArray:52  folders: []
[DEBUG] 01:40:20.130 properties.go:GetBool:22  home_enabled: false
[TRACE] 01:40:20.130 shell.go:Pwd() - 27ns
[DEBUG] 01:40:20.130 block.go:Debug:280  Segment: python
[DEBUG] 01:40:20.130 properties.go:GetString:28  environment
[TRACE] 01:40:20.130 shell.go:Pwd() - 28ns
[TRACE] 01:40:20.130 shell.go:GOOS() - 20ns
[DEBUG] 01:40:20.130 properties.go:GetStringArray:52  extensions: [*.py *.ipynb pyproject.toml venv.bak]
[DEBUG] 01:40:20.130 properties.go:GetStringArray:52  folders: [.venv venv virtualenv env venv-win pyenv-win]
[DEBUG] 01:40:20.130 properties.go:GetBool:22  home_enabled: false
[TRACE] 01:40:20.130 shell.go:Pwd() - 27ns
[DEBUG] 01:40:20.130 block.go:Debug:280  Segment: java
[DEBUG] 01:40:20.131 shell.go:Getenv:397  NO DATA
[TRACE] 01:40:20.131 shell.go:Getenv(JAVA_HOME) - 1.97┬Ás
[TRACE] 01:40:20.131 shell.go:Pwd() - 33ns
[TRACE] 01:40:20.131 shell.go:GOOS() - 20ns
[DEBUG] 01:40:20.131 properties.go:GetStringArray:52  extensions: [pom.xml build.gradle.kts build.sbt .java-version .deps.edn project.clj build.boot *.java *.class *.gradle *.jar *.clj *.cljc]
[DEBUG] 01:40:20.131 properties.go:GetStringArray:52  folders: []
[DEBUG] 01:40:20.131 properties.go:GetBool:22  home_enabled: false
[TRACE] 01:40:20.131 shell.go:Pwd() - 26ns
[DEBUG] 01:40:20.131 block.go:Debug:280  Segment: dotnet
[TRACE] 01:40:20.131 shell.go:Pwd() - 57ns
[TRACE] 01:40:20.131 shell.go:GOOS() - 31ns
[DEBUG] 01:40:20.131 properties.go:GetStringArray:52  extensions: [*.cs *.csx *.vb *.sln *.slnf *.csproj *.vbproj *.fs *.fsx *.fsproj global.json]
[DEBUG] 01:40:20.131 properties.go:GetStringArray:52  folders: []
[DEBUG] 01:40:20.131 properties.go:GetBool:22  home_enabled: false
[TRACE] 01:40:20.131 shell.go:Pwd() - 26ns
[DEBUG] 01:40:20.131 block.go:Debug:280  Segment: go
[TRACE] 01:40:20.131 shell.go:Pwd() - 27ns
[TRACE] 01:40:20.131 shell.go:GOOS() - 22ns
[DEBUG] 01:40:20.131 properties.go:GetStringArray:52  extensions: [*.go go.mod]
[DEBUG] 01:40:20.131 properties.go:GetStringArray:52  folders: []
[DEBUG] 01:40:20.131 properties.go:GetBool:22  home_enabled: false
[TRACE] 01:40:20.131 shell.go:Pwd() - 29ns
[DEBUG] 01:40:20.131 block.go:Debug:280  Segment: rust
[TRACE] 01:40:20.131 shell.go:Pwd() - 27ns
[TRACE] 01:40:20.131 shell.go:GOOS() - 19ns
[DEBUG] 01:40:20.131 properties.go:GetStringArray:52  extensions: [*.rs Cargo.toml Cargo.lock]
[DEBUG] 01:40:20.131 properties.go:GetStringArray:52  folders: []
[DEBUG] 01:40:20.131 properties.go:GetBool:22  home_enabled: false
[TRACE] 01:40:20.131 shell.go:Pwd() - 28ns
[DEBUG] 01:40:20.131 block.go:Debug:280  Segment: dart
[TRACE] 01:40:20.131 shell.go:Pwd() - 27ns
[TRACE] 01:40:20.131 shell.go:GOOS() - 18ns
[DEBUG] 01:40:20.131 properties.go:GetStringArray:52  extensions: [*.dart pubspec.yaml pubspec.yml pubspec.lock]
[DEBUG] 01:40:20.131 properties.go:GetStringArray:52  folders: [.dart_tool]
[DEBUG] 01:40:20.131 properties.go:GetBool:22  home_enabled: false
[TRACE] 01:40:20.131 shell.go:Pwd() - 30ns
[DEBUG] 01:40:20.131 block.go:Debug:280  Segment: angular
[TRACE] 01:40:20.131 shell.go:Pwd() - 27ns
[TRACE] 01:40:20.131 shell.go:GOOS() - 18ns
[DEBUG] 01:40:20.131 properties.go:GetStringArray:52  extensions: [angular.json]
[DEBUG] 01:40:20.131 properties.go:GetStringArray:52  folders: []
[DEBUG] 01:40:20.131 properties.go:GetBool:22  home_enabled: false
[TRACE] 01:40:20.131 shell.go:Pwd() - 29ns
[DEBUG] 01:40:20.131 block.go:Debug:280  Segment: julia
[TRACE] 01:40:20.131 shell.go:Pwd() - 28ns
[TRACE] 01:40:20.131 shell.go:GOOS() - 17ns
[DEBUG] 01:40:20.131 properties.go:GetStringArray:52  extensions: [*.jl]
[DEBUG] 01:40:20.131 properties.go:GetStringArray:52  folders: []
[DEBUG] 01:40:20.131 properties.go:GetBool:22  home_enabled: false
[TRACE] 01:40:20.131 shell.go:Pwd() - 30ns
[DEBUG] 01:40:20.131 block.go:Debug:280  Segment: ruby
[TRACE] 01:40:20.131 shell.go:Pwd() - 27ns
[TRACE] 01:40:20.131 shell.go:GOOS() - 18ns
[DEBUG] 01:40:20.131 properties.go:GetStringArray:52  extensions: [*.rb Rakefile Gemfile]
[DEBUG] 01:40:20.131 properties.go:GetStringArray:52  folders: []
[DEBUG] 01:40:20.131 properties.go:GetBool:22  home_enabled: false
[TRACE] 01:40:20.131 shell.go:Pwd() - 30ns
[DEBUG] 01:40:20.131 block.go:Debug:280  Segment: azfunc
[TRACE] 01:40:20.131 shell.go:Pwd() - 39ns
[TRACE] 01:40:20.131 shell.go:GOOS() - 17ns
[DEBUG] 01:40:20.131 properties.go:GetStringArray:52  extensions: [host.json local.settings.json function.json]
[DEBUG] 01:40:20.131 properties.go:GetStringArray:52  folders: []
[DEBUG] 01:40:20.131 properties.go:GetBool:22  home_enabled: false
[TRACE] 01:40:20.131 shell.go:Pwd() - 28ns
[DEBUG] 01:40:20.131 block.go:Debug:280  Segment: aws
[TRACE] 01:40:20.131 shell.go:Pwd() - 27ns
[TRACE] 01:40:20.131 shell.go:GOOS() - 18ns
[DEBUG] 01:40:20.131 properties.go:GetBool:22  display_default: true
[DEBUG] 01:40:20.131 shell.go:Getenv:397  NO DATA
[TRACE] 01:40:20.131 shell.go:Getenv(AWS_VAULT) - 1.017┬Ás
[DEBUG] 01:40:20.131 shell.go:Getenv:397  NO DATA
[TRACE] 01:40:20.131 shell.go:Getenv(AWS_DEFAULT_PROFILE) - 974ns
[DEBUG] 01:40:20.131 shell.go:Getenv:397  NO DATA
[TRACE] 01:40:20.131 shell.go:Getenv(AWS_PROFILE) - 988ns
[DEBUG] 01:40:20.131 shell.go:Getenv:397  NO DATA
[TRACE] 01:40:20.131 shell.go:Getenv(AWS_REGION) - 932ns
[DEBUG] 01:40:20.131 shell.go:Getenv:397  NO DATA
[TRACE] 01:40:20.131 shell.go:Getenv(AWS_DEFAULT_REGION) - 886ns
[DEBUG] 01:40:20.131 shell.go:Getenv:397  NO DATA
[TRACE] 01:40:20.131 shell.go:Getenv(AWS_CONFIG_FILE) - 1.145┬Ás
[ERROR] 01:40:20.131 shell.go:FileContent:518  open /home/jamie/.aws/config: no such file or directory
[TRACE] 01:40:20.131 shell.go:FileContent(/home/jamie/.aws/config) - 4.479┬Ás
[DEBUG] 01:40:20.131 block.go:Debug:280  Segment: kubectl
[TRACE] 01:40:20.131 shell.go:Pwd() - 27ns
[TRACE] 01:40:20.131 shell.go:GOOS() - 18ns
[DEBUG] 01:40:20.131 properties.go:GetBool:22  parse_kubeconfig: false
[ERROR] 01:40:20.258 shell.go:CommandPath:602  exec: "kubectl": executable file not found in $PATH
[TRACE] 01:40:20.258 shell.go:CommandPath(kubectl) - 127.376665ms
[TRACE] 01:40:20.258 shell.go:HasCommand(kubectl) - 127.379322ms
[DEBUG] 01:40:20.258 block.go:Debug:280  Segment: exit
[TRACE] 01:40:20.258 shell.go:Pwd() - 128ns
[TRACE] 01:40:20.258 shell.go:GOOS() - 46ns
[TRACE] 01:40:20.258 shell.go:ErrorCode() - 32ns
[DEBUG] 01:40:20.258 properties.go:GetBool:22  always_enabled: true
[TRACE] 01:40:20.259 shell.go:TemplateCache() - 182ns
[TRACE] 01:40:20.259 shell.go:TemplateCache() - 61ns
[TRACE] 01:40:20.259 shell.go:Shell() - 88ns
[TRACE] 01:40:20.259 shell.go:TemplateCache() - 76ns
[DEBUG] 01:40:20.259 block.go:Debug:280  Segment: executiontime
[TRACE] 01:40:20.259 shell.go:Pwd() - 64ns
[TRACE] 01:40:20.259 shell.go:GOOS() - 44ns
[DEBUG] 01:40:20.259 properties.go:GetBool:22  always_enabled: false
[TRACE] 01:40:20.259 shell.go:ExecutionTime() - 47ns
[DEBUG] 01:40:20.259 properties.go:GetFloat64:34  threshold: 0.000000
[DEBUG] 01:40:20.259 properties.go:GetString:28  roundrock
[TRACE] 01:40:20.259 shell.go:TemplateCache() - 50ns
[TRACE] 01:40:20.259 shell.go:TemplateCache() - 63ns
[TRACE] 01:40:20.259 shell.go:Shell() - 41ns
[DEBUG] 01:40:20.259 block.go:Debug:280  Segment: battery
[TRACE] 01:40:20.259 shell.go:Pwd() - 53ns
[TRACE] 01:40:20.259 shell.go:GOOS() - 32ns
[DEBUG] 01:40:20.259 shell_unix.go:IsWsl:35  true
[TRACE] 01:40:20.259 shell_unix.go:IsWsl() - 1.78┬Ás
[DEBUG] 01:40:20.259 shell_unix.go:IsWsl:35  true
[TRACE] 01:40:20.259 shell_unix.go:IsWsl() - 1.356┬Ás
[DEBUG] 01:40:20.259 shell.go:FileContent:522 Ôåô
    5.15.90.1-microsoft-standard-WSL2

[TRACE] 01:40:20.259 shell.go:FileContent(/proc/sys/kernel/osrelease) - 32.272┬Ás
[TRACE] 01:40:20.259 shell_unix.go:IsWsl2() - 37.008┬Ás
[TRACE] 01:40:20.259 shell_windows_nix.go:BatteryState() - 273.459┬Ás
[TRACE] 01:40:20.259 shell.go:TemplateCache() - 121ns
[TRACE] 01:40:20.259 shell.go:TemplateCache() - 98ns
[TRACE] 01:40:20.259 shell.go:Shell() - 260ns
[TRACE] 01:40:20.259 shell.go:TemplateCache() - 46ns
[TRACE] 01:40:20.260 shell.go:TemplateCache() - 60ns
[TRACE] 01:40:20.260 shell.go:TemplateCache() - 40ns
[DEBUG] 01:40:20.260 block.go:Debug:280  Segment: time
[TRACE] 01:40:20.260 shell.go:Pwd() - 135ns
[TRACE] 01:40:20.260 shell.go:GOOS() - 47ns
[DEBUG] 01:40:20.260 properties.go:GetString:28  3:04 PM
[TRACE] 01:40:20.260 shell.go:TemplateCache() - 284ns
[TRACE] 01:40:20.260 shell.go:TemplateCache() - 104ns
[TRACE] 01:40:20.260 shell.go:Shell() - 133ns
[TRACE] 01:40:20.260 shell.go:Flags() - 36ns
[DEBUG] 01:40:20.260 block.go:Debug:280  Segment: text
[TRACE] 01:40:20.260 shell.go:Pwd() - 56ns
[TRACE] 01:40:20.260 shell.go:GOOS() - 48ns
[TRACE] 01:40:20.260 shell.go:TemplateCache() - 48ns
[TRACE] 01:40:20.260 shell.go:Shell() - 19ns
[DEBUG] 01:40:20.260 block.go:Debug:280  Segment: exit
[TRACE] 01:40:20.260 shell.go:Pwd() - 32ns
[TRACE] 01:40:20.260 shell.go:GOOS() - 18ns
[TRACE] 01:40:20.260 shell.go:ErrorCode() - 43ns
[DEBUG] 01:40:20.260 properties.go:GetBool:22  always_enabled: true
[TRACE] 01:40:20.260 shell.go:TemplateCache() - 40ns
[TRACE] 01:40:20.260 shell.go:Shell() - 33ns
[TRACE] 01:40:20.260 shell.go:TemplateCache() - 84ns
[DEBUG] 01:40:20.260 shell.go:Getenv:397  NO DATA
[TRACE] 01:40:20.260 shell.go:Getenv(XDG_CACHE_HOME) - 11.388┬Ás
[TRACE] 01:40:20.260 shell_unix.go:CachePath() - 23.936┬Ás
[TRACE] 01:40:20.260 shell.go:Flags() - 33ns
michaelrommel commented 1 year ago

Hm, spelling error? MANUFACTUER vs. MaNUFACTURER

export MANUFACTUER=unknown
"template": "{{ if eq .Env.MANUFACTURER \"Razer\" }}Razer{{end}} {{.Env}} <transparent>\ue0b0</> {{.Icon}}"
JanDeDobbeleer commented 1 year ago

Hm, spelling error? MANUFACTUER vs. MaNUFACTURER

export MANUFACTUER=unknown
"template": "{{ if eq .Env.MANUFACTURER \"Razer\" }}Razer{{end}} {{.Env}} <transparent>\ue0b0</> {{.Icon}}"

Indeed, didn't catch that but yes. It's a typo. MANUFACTURER:Razer is available in the env vars.

j-maynard commented 1 year ago

Hi Peoples... I'm sorry but I still believe this is a bug. You've focused on the line with {{.Env}} but not the line above it. Which is also not working with the correct spelling. You've also not looked at my Env Map where Razer and Manufactuerer are both missing. Also I covered I tried this with a different Env variable (PC_TYPE) with the same result. This does seem to be unique to WSL as I don't get the same result on my Ubuntu install which doesn't have the same bug and but does use the same dot-files to populate the variable.

Probably helps if I add a link to my dot-files... https://gitlab.com/j-maynard/dot-files

JanDeDobbeleer commented 1 year ago

@j-maynard the latest version of oh-my-posh now prints everything it has in .Env when using debug. That way you can validate the template yourself too. And, as we have zero other reports of .Env failing to work, and I can consistently make it work on my end for every shell, makes me go in the direction of a misconfiguration.

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