Closed j-maynard closed 1 year ago
Hm, spelling error? MANUFACTUER vs. MaNUFACTURER
export MANUFACTUER=unknown
"template": "{{ if eq .Env.MANUFACTURER \"Razer\" }}Razer{{end}} {{.Env}} <transparent>\ue0b0</> {{.Icon}}"
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.
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
@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.
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.
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.
My Env
oh-my-posh environment (gather by using {{ .Env }} in a template:
Theme
What OS are you seeing the problem on?
Windows, Linux
Which shell are you using?
bash, zsh
Log output