84b9598e4e3d3509d11618b84de4db5057629cd2
- Author
- Robby Russell <robby@planetargon.com>
- Committer
- Robby Russell <robby@planetargon.com>
- Date
Message
Merge pull request #1909 from gonghao/master
add virtualenv prompt support for agnoster theme
Diff
1diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
2index e652938588ab95ab9b790e37cd3047f7998e4070..c7a59ad0d67951960f1a9edb4544bd1da6aa849e 100644
3--- a/themes/agnoster.zsh-theme
4+++ b/themes/agnoster.zsh-theme
5@@ -134,6 +134,14 @@ prompt_dir() {
6 prompt_segment blue black '%~'
7 }
8
9+# Virtualenv: current working virtualenv
10+prompt_virtualenv() {
11+ local virtualenv_path="$VIRTUAL_ENV"
12+ if [[ -n $virtualenv_path ]]; then
13+ prompt_segment blue black "(`basename $virtualenv_path`)"
14+ fi
15+}
16+
17 # Status:
18 # - was there an error
19 # - am I root
20@@ -152,6 +160,7 @@ prompt_status() {
21 build_prompt() {
22 RETVAL=$?
23 prompt_status
24+ prompt_virtualenv
25 prompt_context
26 prompt_dir
27 prompt_git