From ebfc9042ed2121c1d330a6767736fbf7bff2e369 Mon Sep 17 00:00:00 2001 From: Gong Hao Date: Tue, 25 Jun 2013 12:26:42 +0800 Subject: [PATCH] add virtualenv prompt support for agnoster theme --- themes/agnoster.zsh-theme | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index e6529385..c7a59ad0 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -134,6 +134,14 @@ prompt_dir() { prompt_segment blue black '%~' } +# Virtualenv: current working virtualenv +prompt_virtualenv() { + local virtualenv_path="$VIRTUAL_ENV" + if [[ -n $virtualenv_path ]]; then + prompt_segment blue black "(`basename $virtualenv_path`)" + fi +} + # Status: # - was there an error # - am I root @@ -152,6 +160,7 @@ prompt_status() { build_prompt() { RETVAL=$? prompt_status + prompt_virtualenv prompt_context prompt_dir prompt_git