Skip to content

Commit

Permalink
skylerlee#5: Show virtualenv on prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalezzfelipe committed May 13, 2020
1 parent 01e8652 commit d295afb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion zeta.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ function get_space {
echo $space
}

function get_virtualenv_prompt {
local virtualenv_path="$VIRTUAL_ENV"
if [[ -n $virtualenv_path && -n $VIRTUAL_ENV_DISABLE_PROMPT ]]; then
echo "(%{$green%}$(basename $virtualenv_path)%{$reset_color%})"
else
echo ""
fi
}

# Prompt: # USER@MACHINE: DIRECTORY <BRANCH [STATUS]> --- (TIME_STAMP)
# > command
function print_prompt_head {
Expand All @@ -103,7 +112,8 @@ function print_prompt_head {
%{$blue%}@\
%{$cyan_bold%}$(get_box_name): \
%{$yellow_bold%}$(get_current_dir)%{$reset_color%}\
$(get_git_prompt) "
$(get_git_prompt) \
$(get_virtualenv_prompt) "
local right_prompt="%{$blue%}($(get_time_stamp))%{$reset_color%} "
print -rP "$left_prompt$(get_space $left_prompt $right_prompt)$right_prompt"
}
Expand Down

0 comments on commit d295afb

Please sign in to comment.