Closed benozol closed 2 years ago
@benozol I think this use-case is a bit too specific for Pure. We can revisit this if more people find it useful. Thanks for thinking of us and submitting a PR though!
You could also achieve this without modifying Pure, using e.g. RPROMPT
.
monitor() {
for var in $PURE_MONITOR_VARIABLES; do
if [[ -n "${(P)var}" ]]; then
preprompt_parts+=" $var=${(P)var}"
fi
done
}
RPROMPT='$(monitor)'
~
❯ PURE_MONITOR_VARIABLES=(var1)
~
❯ var1=hello
~
❯ var1=hello
trying to upstream my config – and getting a much better solution… thanks!
pure is really nice, thanks!
this PR allows to monitor the value of environment variables with pure. I found it quite useful when working with commands that use environment variables.