diff --git a/prompt_fresh_setup b/prompt_fresh_setup index dd9cdc6..9efa9fb 100644 --- a/prompt_fresh_setup +++ b/prompt_fresh_setup @@ -19,7 +19,7 @@ prompt_fresh_setup() { PS1="«$user» " PS2="${(l:$length + 1:: :)}» " - # TODO: RPS1 + RPS1='$(fresh_rprompt)' prompt_opts=(cr percent sp subst) } @@ -104,6 +104,17 @@ fresh_precmd() { fi } +fresh_rprompt() { + rprompt="" + if [[ ! -z "$DOCKER_MACHINE_NAME" ]]; then + rprompt="$rprompt %{%F{3}%}$DOCKER_MACHINE_NAME%{%f%}" + fi + if [[ ! -z "$VIRTUAL_ENV" ]]; then + rprompt="$rprompt %{%F{3}%}$(basename $VIRTUAL_ENV)%{%f%}" + fi + echo $rprompt +} + visible_length() { echo $(( ${#${(S%%)1//(\%(KF1]|)\{*\}|\%[Bbkf])}} )) }