Oh-my-posh gives config error when trying to set it up as non root user. #4115
-
Code of Conduct
What happened?So I am trying to set up oh-my-posh in WSL2. It works perfectly fine when i run The problem occurs when i try the same command logged in as another user. It always gives a config error. I am a new linux user so please forgive for any silly mistakes or misunderstanding. Any help is appreciated. Thanks. ThemeI am trying to apply microverse-power theme. result when running the command as user tushar. result of command as root user. What OS are you seeing the problem on?Linux Which shell are you using?bash Log outputVersion: 18.2.0
Shell: bash (5.1.16(1)-release)
Segments:
ConsoleTitle(true) - 0 ms - bash in tushar
session(true) - 0 ms - tushar
path(true) - 2 ms - ~
git(false) - 3 ms -
root(false) - 0 ms -
exit(true) - 0 ms - CONFIG ERROR
node(false) - 0 ms -
go(false) - 0 ms -
python(false) - 0 ms -
shell(true) - 0 ms - in bash
time(true) - 0 ms - at 15:55:04
Run duration: 11.119752ms
Cache path: /home/tushar/.cache/oh-my-posh
Config path: /home/tushar/.cache/oh-my-posh/themes/microverse-power.omp.json
Logs:
[DEBUG] 15:55:04.763 shell.go:Getenv:398 → NO DATA
[TRACE] 15:55:04.763 shell.go:Getenv(TERM_PROGRAM) - 23.174µs
[DEBUG] 15:55:04.763 shell.go:Getenv:398 → NO DATA
[TRACE] 15:55:04.763 shell.go:Getenv(XDG_CACHE_HOME) - 4.308µs
[TRACE] 15:55:04.763 shell_unix.go:CachePath() - 20.989µs
[DEBUG] 15:55:04.764 shell.go:Getenv:398 → /home/tushar/.cache/oh-my-posh/themes/microverse-power.omp.json
[TRACE] 15:55:04.764 shell.go:Getenv(POSH_THEME) - 8.486µs
[DEBUG] 15:55:04.764 shell_unix.go:Platform:71 → ubuntu
[TRACE] 15:55:04.764 shell.go:resolveConfigPath() - 29.225µs
[TRACE] 15:55:04.764 shell.go:Init() - 662.95µs
[TRACE] 15:55:04.764 shell.go:Flags() - 90ns
[ERROR] 15:55:04.764 config.go:loadConfig:159 → open /home/tushar/.cache/oh-my-posh/themes/microverse-power.omp.json: no such file or directory
[TRACE] 15:55:04.764 config.go:loadConfig() - 66.918µs
[TRACE] 15:55:04.764 shell.go:Flags() - 61ns
[DEBUG] 15:55:04.764 shell.go:Getenv:398 → NO DATA
[TRACE] 15:55:04.764 shell.go:Getenv(OMP_CACHE_DISABLED) - 6.833µs
[DEBUG] 15:55:04.764 shell.go:Shell:638 → no shell name provided in flags, trying to detect it
[DEBUG] 15:55:04.765 shell.go:Shell:646 → process name: bash
[TRACE] 15:55:04.765 shell.go:Shell() - 1.244978ms
[DEBUG] 15:55:04.765 shell.go:Getenv:398 → 5.1.16(1)-release
[TRACE] 15:55:04.765 shell.go:Getenv(POSH_SHELL_VERSION) - 8.336µs
[DEBUG] 15:55:04.765 debug.go:PrintDebug:23 → Segment: Title
[TRACE] 15:55:04.766 shell_unix.go:Root() - 1.202µs
[TRACE] 15:55:04.766 shell.go:Shell() - 220ns
[TRACE] 15:55:04.766 shell.go:StatusCodes() - 240ns
[DEBUG] 15:55:04.766 shell_unix.go:IsWsl:35 → true
[TRACE] 15:55:04.766 shell_unix.go:IsWsl() - 8.316µs
[DEBUG] 15:55:04.766 shell.go:TemplateCache:816 → environment: [SHELL=/bin/bash WSL2_GUI_APPS_ENABLED=1 CONDA_EXE=/home/tushar/miniconda3/bin/conda _CE_M= POSH_PID=466 WSL_DISTRO_NAME=Ubuntu-22.04 WT_SESSION=678a1901-a719-4313-bdb2-0da329ed7011 NAME=Family PWD=/home/tushar LOGNAME=tushar HOME=/home/tushar LANG=C.UTF-8 WSL_INTEROP=/run/WSL/463_interop LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36: POSH_SHELL_VERSION=5.1.16(1)-release WAYLAND_DISPLAY=wayland-0 CONDA_PROMPT_MODIFIER=false LESSCLOSE=/usr/bin/lesspipe %s %s TERM=xterm-256color _CE_CONDA= LESSOPEN=| /usr/bin/lesspipe %s USER=tushar CONDA_SHLVL=0 DISPLAY=:0 SHLVL=1 POSH_THEME=/home/tushar/.cache/oh-my-posh/themes/microverse-power.omp.json CONDA_PYTHON_EXE=/home/tushar/miniconda3/bin/python XDG_RUNTIME_DIR=/run/user/1000/ WSLENV=WT_SESSION::WT_PROFILE_ID XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop PATH=/home/tushar/miniconda3/condabin:/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/Users/tusha/miniconda3:/mnt/c/Users/tusha/miniconda3/Library/mingw-w64/bin:/mnt/c/Users/tusha/miniconda3/Library/usr/bin:/mnt/c/Users/tusha/miniconda3/Library/bin:/mnt/c/Users/tusha/miniconda3/Scripts:/mnt/c/Users/tusha/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/tusha/AppData/Local/Programs/Microsoft VS Code/bin:/snap/bin DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus HOSTTYPE=x86_64 POWERLINE_COMMAND=oh-my-posh PULSE_SERVER=unix:/mnt/wslg/PulseServer WT_PROFILE_ID={d7b20cea-47a9-518c-95a4-c8bd91e2e1c6} OLDPWD=/home/tushar/.cache _=/usr/local/bin/oh-my-posh]
[TRACE] 15:55:04.766 shell.go:GOOS() - 151ns
[DEBUG] 15:55:04.766 shell.go:Pwd:428 → /home/tushar
[TRACE] 15:55:04.766 shell.go:Pwd() - 29.316µs
[TRACE] 15:55:04.766 shell.go:GOOS() - 70ns
[TRACE] 15:55:04.766 shell.go:GOOS() - 60ns
[TRACE] 15:55:04.766 shell.go:GOOS() - 60ns
[TRACE] 15:55:04.766 shell.go:GOOS() - 60ns
[TRACE] 15:55:04.766 shell.go:GOOS() - 60ns
[TRACE] 15:55:04.766 shell.go:GOOS() - 60ns
[TRACE] 15:55:04.766 shell.go:GOOS() - 60ns
[TRACE] 15:55:04.766 shell.go:GOOS() - 60ns
[DEBUG] 15:55:04.766 shell.go:User:549 → tushar
[TRACE] 15:55:04.766 shell.go:User() - 4.549µs
[DEBUG] 15:55:04.766 shell.go:Host:561 → Family
[TRACE] 15:55:04.766 shell.go:Host() - 6.803µs
[TRACE] 15:55:04.766 shell.go:GOOS() - 60ns
[DEBUG] 15:55:04.766 shell_unix.go:Platform:71 → ubuntu
[DEBUG] 15:55:04.766 shell.go:Getenv:398 → 1
[TRACE] 15:55:04.766 shell.go:Getenv(SHLVL) - 3.978µs
[TRACE] 15:55:04.766 shell.go:TemplateCache() - 320.248µs
[TRACE] 15:55:04.766 shell.go:Flags() - 190ns
[DEBUG] 15:55:04.766 block.go:Debug:280 → Segment: session
[TRACE] 15:55:04.766 shell.go:Pwd() - 140ns
[TRACE] 15:55:04.766 shell.go:GOOS() - 60ns
[DEBUG] 15:55:04.766 shell.go:Getenv:398 → NO DATA
[TRACE] 15:55:04.766 shell.go:Getenv(SSH_CONNECTION) - 9.117µs
[DEBUG] 15:55:04.766 shell.go:Getenv:398 → NO DATA
[TRACE] 15:55:04.766 shell.go:Getenv(SSH_CLIENT) - 2.816µs
[TRACE] 15:55:04.766 shell.go:TemplateCache() - 191ns
[TRACE] 15:55:04.767 shell.go:TemplateCache() - 280ns
[TRACE] 15:55:04.767 shell.go:Shell() - 150ns
[DEBUG] 15:55:04.767 block.go:Debug:280 → Segment: path
[TRACE] 15:55:04.767 shell.go:Pwd() - 140ns
[TRACE] 15:55:04.767 shell.go:GOOS() - 60ns
[TRACE] 15:55:04.767 shell.go:Pwd() - 70ns
[TRACE] 15:55:04.767 shell.go:Shell() - 80ns
[TRACE] 15:55:04.767 shell.go:Shell() - 90ns
[DEBUG] 15:55:04.767 properties.go:GetBool:22 → mapped_locations_enabled: true
[DEBUG] 15:55:04.767 properties.go:GetString:28 →
[DEBUG] 15:55:04.767 properties.go:GetString:28 →
[TRACE] 15:55:04.767 shell.go:GOOS() - 60ns
[DEBUG] 15:55:04.767 properties.go:GetString:28 → ~
[DEBUG] 15:55:04.767 properties.go:GetKeyValueMap:46 → mapped_locations: map[]
[TRACE] 15:55:04.767 shell.go:PathSeparator() - 190ns
[TRACE] 15:55:04.767 shell.go:GOOS() - 60ns
[TRACE] 15:55:04.767 shell.go:GOOS() - 60ns
[TRACE] 15:55:04.767 shell.go:GOOS() - 60ns
[TRACE] 15:55:04.767 shell.go:GOOS() - 60ns
[TRACE] 15:55:04.767 shell.go:PathSeparator() - 60ns
[TRACE] 15:55:04.767 shell.go:PathSeparator() - 60ns
[TRACE] 15:55:04.767 shell.go:GOOS() - 61ns
[TRACE] 15:55:04.767 shell.go:GOOS() - 60ns
[TRACE] 15:55:04.767 shell.go:PathSeparator() - 60ns
[TRACE] 15:55:04.767 shell.go:GOOS() - 60ns
[TRACE] 15:55:04.767 shell.go:GOOS() - 60ns
[TRACE] 15:55:04.767 shell.go:PathSeparator() - 60ns
[TRACE] 15:55:04.767 shell.go:GOOS() - 60ns
[TRACE] 15:55:04.767 shell.go:GOOS() - 60ns
[TRACE] 15:55:04.767 shell.go:PathSeparator() - 60ns
[TRACE] 15:55:04.767 shell.go:Pwd() - 70ns
[DEBUG] 15:55:04.767 shell_unix.go:IsWsl:35 → true
[TRACE] 15:55:04.767 shell_unix.go:IsWsl() - 13.075µs
[DEBUG] 15:55:04.769 shell.go:RunCommand:579 → //wsl.localhost/Ubuntu-22.04/home/tushar
[TRACE] 15:55:04.769 shell.go:RunCommand(wslpath -m /home/tushar) - 1.340649ms
[TRACE] 15:55:04.769 shell.go:StackCount() - 181ns
[TRACE] 15:55:04.769 shell_unix.go:DirIsWritable(/home/tushar) - 7.744µs
[TRACE] 15:55:04.769 shell.go:TemplateCache() - 341ns
[TRACE] 15:55:04.769 shell.go:TemplateCache() - 391ns
[TRACE] 15:55:04.769 shell.go:Shell() - 170ns
[DEBUG] 15:55:04.769 block.go:Debug:280 → Segment: git
[TRACE] 15:55:04.769 shell.go:Pwd() - 160ns
[TRACE] 15:55:04.769 shell.go:GOOS() - 80ns
[DEBUG] 15:55:04.769 shell_unix.go:IsWsl:35 → true
[TRACE] 15:55:04.769 shell_unix.go:IsWsl() - 5.45µs
[DEBUG] 15:55:04.769 shell.go:FileContent:523 ↓
5.15.90.1-microsoft-standard-WSL2
[TRACE] 15:55:04.769 shell.go:FileContent(/proc/sys/kernel/osrelease) - 74.131µs
[TRACE] 15:55:04.769 shell_unix.go:IsWsl2() - 97.655µs
[TRACE] 15:55:04.769 shell.go:Pwd() - 100ns
[DEBUG] 15:55:04.773 shell.go:RunCommand:579 → //wsl.localhost/Ubuntu-22.04/home/tushar
[TRACE] 15:55:04.773 shell.go:RunCommand(wslpath -m /home/tushar) - 3.579095ms
[TRACE] 15:55:04.773 shell.go:GOOS() - 111ns
[DEBUG] 15:55:04.773 shell.go:CommandPath:600 → /usr/bin/git
[TRACE] 15:55:04.773 shell.go:CommandPath(git) - 39.545µs
[TRACE] 15:55:04.773 shell.go:HasCommand(git) - 44.305µs
[TRACE] 15:55:04.773 shell.go:Pwd() - 151ns
[ERROR] 15:55:04.773 shell.go:HasParentFilePath:734 → stat .git: no such file or directory
[TRACE] 15:55:04.773 shell.go:HasParentFilePath(.git) - 63.17µs
[DEBUG] 15:55:04.773 properties.go:GetBool:22 → fetch_bare_info: false
[DEBUG] 15:55:04.773 block.go:Debug:280 → Segment: root
[TRACE] 15:55:04.773 shell.go:Pwd() - 110ns
[TRACE] 15:55:04.773 shell.go:GOOS() - 60ns
[TRACE] 15:55:04.773 shell_unix.go:Root() - 461ns
[DEBUG] 15:55:04.773 block.go:Debug:280 → Segment: exit
[DEBUG] 15:55:04.773 properties.go:GetString:28 → {{ .Code }}
[TRACE] 15:55:04.773 shell.go:Pwd() - 60ns
[TRACE] 15:55:04.773 shell.go:GOOS() - 60ns
[TRACE] 15:55:04.773 shell.go:StatusCodes() - 91ns
[TRACE] 15:55:04.773 shell.go:TemplateCache() - 331ns
[DEBUG] 15:55:04.773 properties.go:GetBool:22 → always_enabled: true
[TRACE] 15:55:04.773 shell.go:TemplateCache() - 110ns
[TRACE] 15:55:04.773 shell.go:Shell() - 150ns
[TRACE] 15:55:04.774 shell.go:Flags() - 90ns
[DEBUG] 15:55:04.774 block.go:Debug:280 → Segment: node
[TRACE] 15:55:04.774 shell.go:Pwd() - 130ns
[TRACE] 15:55:04.774 shell.go:GOOS() - 60ns
[DEBUG] 15:55:04.774 properties.go:GetStringArray:52 → extensions: [*.js *.ts package.json .nvmrc pnpm-workspace.yaml .pnpmfile.cjs .npmrc .vue]
[DEBUG] 15:55:04.774 properties.go:GetStringArray:52 → folders: []
[DEBUG] 15:55:04.774 properties.go:GetBool:22 → home_enabled: false
[TRACE] 15:55:04.774 shell.go:Pwd() - 70ns
[DEBUG] 15:55:04.774 block.go:Debug:280 → Segment: go
[TRACE] 15:55:04.774 shell.go:Pwd() - 70ns
[TRACE] 15:55:04.774 shell.go:GOOS() - 60ns
[DEBUG] 15:55:04.774 properties.go:GetStringArray:52 → extensions: [*.go go.mod]
[DEBUG] 15:55:04.774 properties.go:GetStringArray:52 → folders: []
[DEBUG] 15:55:04.774 properties.go:GetBool:22 → home_enabled: false
[TRACE] 15:55:04.774 shell.go:Pwd() - 60ns
[DEBUG] 15:55:04.774 block.go:Debug:280 → Segment: python
[DEBUG] 15:55:04.774 properties.go:GetString:28 → files
[TRACE] 15:55:04.774 shell.go:Pwd() - 70ns
[TRACE] 15:55:04.774 shell.go:GOOS() - 60ns
[DEBUG] 15:55:04.774 properties.go:GetStringArray:52 → extensions: [*.py *.ipynb pyproject.toml venv.bak]
[DEBUG] 15:55:04.774 properties.go:GetStringArray:52 → folders: [.venv venv virtualenv env venv-win pyenv-win]
[DEBUG] 15:55:04.774 properties.go:GetBool:22 → home_enabled: false
[TRACE] 15:55:04.774 shell.go:Pwd() - 70ns
[DEBUG] 15:55:04.774 block.go:Debug:280 → Segment: shell
[TRACE] 15:55:04.774 shell.go:Pwd() - 71ns
[TRACE] 15:55:04.774 shell.go:GOOS() - 60ns
[DEBUG] 15:55:04.774 properties.go:GetKeyValueMap:46 → mapped_shell_names: map[]
[TRACE] 15:55:04.774 shell.go:Shell() - 61ns
[TRACE] 15:55:04.774 shell.go:Flags() - 60ns
[TRACE] 15:55:04.774 shell.go:TemplateCache() - 90ns
[TRACE] 15:55:04.774 shell.go:TemplateCache() - 171ns
[TRACE] 15:55:04.774 shell.go:Shell() - 160ns
[DEBUG] 15:55:04.774 block.go:Debug:280 → Segment: time
[TRACE] 15:55:04.774 shell.go:Pwd() - 120ns
[TRACE] 15:55:04.774 shell.go:GOOS() - 71ns
[DEBUG] 15:55:04.774 properties.go:GetString:28 → 15:04:05
[TRACE] 15:55:04.774 shell.go:TemplateCache() - 140ns
[TRACE] 15:55:04.774 shell.go:TemplateCache() - 150ns
[TRACE] 15:55:04.774 shell.go:Shell() - 90ns
[DEBUG] 15:55:04.774 shell.go:Getenv:398 → NO DATA
[TRACE] 15:55:04.774 shell.go:Getenv(XDG_CACHE_HOME) - 5.04µs
[TRACE] 15:55:04.774 shell_unix.go:CachePath() - 26.13µs
[TRACE] 15:55:04.774 shell.go:Flags() - 90ns |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The issue is that you have added the configuration to the
You would need to either reference the same location as the |
Beta Was this translation helpful? Give feedback.
The issue is that you have added the configuration to the
root
user'sHOME
folder, and not your user's home folder. You reference the config using~
which gets resolved to the current userHOME
directory which differs between users. In the logs you see the following:You would need to either reference the same location as the
root
user'sHOME
(probablyhome/root/.cache/oh-my-posh/themes/microverse-power.omp.json
) if that's accessible by your user, or add the configuration to a folder accessible by both.