I can't get the zsh-theme to update all the inner shell scripting with each "return" on the terminal Here is my new oh-my-zsh zsh-theme, updated with an escape character before each code block within $()'s which allows it to update every time the prompt is displayed (works with setopt prompt_subst:
PROMPT=&quot;%F{yellow}%n%F{white}@%F{green}%M %F{cyan}%j %F{white}\$(curl -s https://api.myip.com | jq .ip -r) %F{green}%2c%F{cyan} [%f &quot;
RPROMPT=&quot;\$(git_prompt_info) %F{cyan}] %F{red}\$(top -l 1 | grep 'Load Avg' | awk '{print $3, $4, $5}' | tr -d , | awk '{print $2}')[\$(sysctl hw.ncpu | grep -o -E '[1-9]+')] @ \$(top -l 1 | grep 'CPU usage:' | awk '{print $3, $5, $7}' | tr -d , | awk '{print $3,&quot;%%&quot;}') idle %F{green}%W %* %F{yellow}%D{%p}%f&quot;

ZSH_THEME_GIT_PROMPT_PREFIX=&quot;%F{yellow}&quot;
ZSH_THEME_GIT_PROMPT_SUFFIX=&quot;%f&quot;
ZSH_THEME_GIT_PROMPT_DIRTY=&quot; %F{red}*%f&quot;
ZSH_THEME_GIT_PROMPT_CLEAN=&quot;&quot;

It will dynamically change the date and time, the IP address, and the git_prompt_info, every time I press return, but the shell scripting like \$(top -l 1 | grep 'Load Avg' | awk '{print $3, $4, $5}' | tr -d , | awk '{print $2}') does not update every time I press &quot;return&quot;, it gives me an error instead:
awk: syntax error at source line 1
 context is
    {print &gt;&gt;&gt;  , &lt;&lt;&lt;
awk: illegal statement at source line 1
awk: illegal statement at source line 1

What's going on here?
setopt prompt_subst

Enable prompt_subst in your zshrc or other file sourced by your shell to make zsh re-evaluate your PS1 variable on each prompt appearance.