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) |
Answered by
JanDeDobbeleer
Apr 19, 2025
Replies: 2 comments 1 reply
|
@filviu this calls for a feature request so let's just add that functionality shall we? |
1 reply
|
apologies for the hit and run, life got in the way of my prompt beatification attempts 😁 Thanks a bunch for this ! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@filviu you can now use maps for this.