Commit 804e4e2

Justin Su  ·  2026-02-27 13:08:31 -0500 EST
parent 1e4e888
Use `env_var` module in Starship prompt snippet (#66)

1 files changed,  +9, -10
+9, -10
......@@ -144,7 +144,7 @@ POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS+=my_zmx_session
144144
145145 [oh-my-posh](https://ohmyposh.dev) is a popular shell themeing and prompt engine. This code will display an icon and session name as part of the prompt if (and only if) you have zmx active:
146146
147-```
147+```toml
148148 [[blocks.segments]]
149149 template = '{{ if .Env.ZMX_SESSION }} {{ .Env.ZMX_SESSION }}{{ end }}'
150150 foreground = 'p:orange'
......@@ -153,21 +153,20 @@ POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS+=my_zmx_session
153153 style = 'plain'
154154 ```
155155
156-### starship
156+### Starship
157157
158-[starship](https://starship.rs) is a popular shell themeing and prompt engine. This code will display the session name as part of the prompt if (and only if) you have zmx active:
158+[Starship](https://starship.rs) is a popular shell themeing and prompt engine. This code will display an icon and session name as part of the prompt if (and only if) you have zmx active:
159159
160-```
160+```toml
161161 format = """
162-${custom.zmx}\
162+${env_var.ZMX_SESSION}\
163163 ...
164164 """
165165
166-...
167-
168-[custom.zmx]
169-command = 'echo "[${ZMX_SESSION}]"'
170-when = 'test "${ZMX_SESSION}" != ""'
166+[env_var.ZMX_SESSION]
167+symbol = " "
168+format = "[$symbol$env_value]($style) "
169+description = "zmx session name"
171170 style = "bold magenta"
172171 ```
173172