Conditional variables ? #6372
-
Hi, Just discovered oh-my-posh and I'm in the process of migrating my starship config to better be able to evaluate it. I'm stuck replicating the following starship bit: [username.aliases]
"myusername" = ""
root = ""
[hostname.aliases]
somelongstring = "short_hostname" I searched and I couldn't find aliases like this so next I tried: var:
user_alias: {{if eq .UserName "myusername"}}foo{{else}}{{.UserName}}{{end}} But the above doesn't seem to work. Is there a way to acomplish what I'm trying without adding the same ifs at each step the username is used (title bar, prompt, etc) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@filviu this calls for a feature request so let's just add that functionality shall we? |
Beta Was this translation helpful? Give feedback.
-
apologies for the hit and run, life got in the way of my prompt beatification attempts 😁 Thanks a bunch for this ! |
Beta Was this translation helpful? Give feedback.
@filviu you can now use maps for this.