From a68ff4afe994a5898d30eb05bee228d1c6d87b2e Mon Sep 17 00:00:00 2001 From: Kire Ledan Date: Sun, 29 Nov 2015 10:52:04 -0500 Subject: [PATCH] Added support for python venv display in paradox prompt --- modules/prompt/functions/prompt_paradox_setup | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/prompt/functions/prompt_paradox_setup b/modules/prompt/functions/prompt_paradox_setup index 36ae40ec..7e9b9493 100644 --- a/modules/prompt/functions/prompt_paradox_setup +++ b/modules/prompt/functions/prompt_paradox_setup @@ -52,6 +52,10 @@ function prompt_paradox_build_prompt { prompt_paradox_start_segment green black '${(e)git_info[ref]}${(e)git_info[status]}' fi + if [[ -n "$python_info" ]]; then + prompt_paradox_start_segment white black '${(e)python_info[virtualenv]}' + fi + prompt_paradox_end_segment } @@ -103,6 +107,7 @@ function prompt_paradox_precmd { function prompt_paradox_preexec { _prompt_paradox_start_time="$SECONDS" + python-info } function prompt_paradox_setup { @@ -143,6 +148,9 @@ function prompt_paradox_setup { 'ref' '$(coalesce "%b" "%p" "%c")' \ 'status' '%s%D%A%B%S%a%d%m%r%U%u' + # %v - virtualenv name. + zstyle ':prezto:module:python:info:virtualenv' format 'virtualenv:%v' + # Define prompts. PROMPT=' ${(e)$(prompt_paradox_build_prompt)}