From 0167899377a5938cadbec1881ab2e78a8737db26 Mon Sep 17 00:00:00 2001 From: Dugan Chen Date: Sun, 20 Sep 2020 19:30:25 -0700 Subject: [PATCH] Add virtualenv support to the prompt --- snowblocks/zsh/lib/themes/igloo.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/snowblocks/zsh/lib/themes/igloo.zsh b/snowblocks/zsh/lib/themes/igloo.zsh index 8f21755..5fabe1d 100644 --- a/snowblocks/zsh/lib/themes/igloo.zsh +++ b/snowblocks/zsh/lib/themes/igloo.zsh @@ -297,7 +297,12 @@ prompt_igloo_setup() { local seg_connect_bar_down="${newline}${nord3}${CONNECTBAR_DOWN}${c_reset}" local seg_exit_status="%(?..${nord3}[%(?.${nord9}.${nord11})%?${nord3}]${SPLITBAR}${c_reset})" local seg_jobs="%(1j.${nord3}[${nord9}%j${nord3}]${c_reset}%(?.${nord3}${SPLITBAR}${c_reset}.).)" - local seg_working_dir="${nord3}[${nord9}%~${nord3}]${newline}${c_reset}" + + VENV="" + if [[ "$VIRTUAL_ENV" != "" ]]; then + VENV="($(basename "$VIRTUAL_ENV")) " + fi + local seg_working_dir="${nord3}[${nord9}${VENV}%~${nord3}]${newline}${c_reset}" local seg_time="${nord3}[${nord9}%D{%H:%M:%S}${nord3}]${newline}${CONNECTBAR_UP}${c_reset}" if [[ $IGLOO_ZSH_PROMPT_THEME_HIDE_TIME == true ]]; then