From 6f80c39d3c571a0f557403b1d9e0f3d13466066d Mon Sep 17 00:00:00 2001 From: n00k Date: Thu, 9 Mar 2017 17:35:56 +0100 Subject: [PATCH] add virtual env in bira theme The current virtual env is displayed in paranthesis at the end of the first line (if available). --- themes/bira.zsh-theme | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme index 4b2853c3..1dd9611b 100644 --- a/themes/bira.zsh-theme +++ b/themes/bira.zsh-theme @@ -21,7 +21,15 @@ else fi local git_branch='$(git_prompt_info)%{$reset_color%}' -PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch} +VIRTUAL_ENV_DISABLE_PROMPT="1" +function get_virtualenv() { + if [ -n "${VIRTUAL_ENV}" ]; then + echo "(`basename ${VIRTUAL_ENV}`)" + fi +} +local virtual_env='$(get_virtualenv)' + +PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch} ${virtual_env} ╰─%B${user_symbol}%b " RPS1="%B${return_code}%b"