iTerm ZSH - Missing Right Prompt

Solution 1:

Try wrapping your RPROMPT in single quotes. I've seen double quotes cause issues for others with their prompts before.

I would also ditch the precmd > setprompt process for the moment and just set RPROMPT directly to simplify for testing. Start with something like

precmd() {
  ...
}
PROMPT=$'\n$(rb_prompt) in $(directory_name) $(git_dirty)$(need_push)\n› '
RPROMPT='%{$fg_bold[cyan]%}$(todo)%{$reset_color%}'

and refine from there.

Solution 2:

After investigating - I found a few things that fixed this:

  1. I had some oh-my-zsh plugins that were setting RPS1 instead of RPROMPT - it seems that setting both caused neither to be shown.
  2. Setting RPROMPT in precmd also caused it to disappear.