From 8e142d02ae77ac45335877aaac2c7725607fe312 Mon Sep 17 00:00:00 2001 From: William Ting Date: Sun, 15 Apr 2012 19:37:50 -1000 Subject: [PATCH] show python environment in shell prompt --- themes/wting.zsh-theme | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/themes/wting.zsh-theme b/themes/wting.zsh-theme index 20bb5958c..85fb64683 100644 --- a/themes/wting.zsh-theme +++ b/themes/wting.zsh-theme @@ -38,7 +38,11 @@ local time='${PR_GREEN}%D{%T %Z} ${PR_NO_COLOR}' local user_host='${PR_USER}${PR_CYAN}@${PR_HOST}' local current_dir='%{$PR_BOLD$PR_BLUE%}%~%{$PR_NO_COLOR%}' -# Retrieve Ruby environment info, load RVM if found +# Retrieve Python environment info +PYTHON_VER=`python -c 'import sys; print(sys.version[:5])'` +python_env='%{$PR_RED%}‹python-${PYTHON_VER}›%{$PR_NO_COLOR%}' + +# Retrieve Ruby environment info local ruby_env='' if ${HOME}/.rvm/bin/rvm-prompt &> /dev/null; then # detect local rvm installation ruby_env='%{$PR_RED%}‹$(${HOME}/.rvm/bin/rvm-prompt i v g s)›%{$PR_NO_COLOR%}' @@ -51,7 +55,7 @@ fi # Retrieve git info local git_branch='$(git_prompt_info)%{$PR_NO_COLOR%}' -PROMPT="╭─${user_host} ${current_dir} ${ruby_env} ${git_branch} +PROMPT="╭─${user_host} ${current_dir} ${python_env} ${ruby_env} ${git_branch} ╰─$PR_PROMPT " RPROMPT="${date}${time}"