1
0
Fork 0

Fixed virtualenv support in paradox prompt theme.

pull/1143/head
Patrick Bos 9 years ago
parent a68ff4afe9
commit 93fa50576d

@ -8,6 +8,7 @@
# Isaac Wolkerstorfer <i@agnoster.net> # Isaac Wolkerstorfer <i@agnoster.net>
# Jeff Sandberg <paradox460@gmail.com> # Jeff Sandberg <paradox460@gmail.com>
# Sorin Ionescu <sorin.ionescu@gmail.com> # Sorin Ionescu <sorin.ionescu@gmail.com>
# Patrick Bos <egpbos@gmail.com>
# #
# Screenshots: # Screenshots:
# http://i.imgur.com/0XIWX.png # http://i.imgur.com/0XIWX.png
@ -48,14 +49,14 @@ function prompt_paradox_build_prompt {
prompt_paradox_start_segment black default '%(?::%F{red}✘ )%(!:%F{yellow}⚡ :)%(1j:%F{cyan}⚙ :)%F{blue}%n%F{red}@%F{green}%m%f' prompt_paradox_start_segment black default '%(?::%F{red}✘ )%(!:%F{yellow}⚡ :)%(1j:%F{cyan}⚙ :)%F{blue}%n%F{red}@%F{green}%m%f'
prompt_paradox_start_segment blue black '$_prompt_paradox_pwd' prompt_paradox_start_segment blue black '$_prompt_paradox_pwd'
if [[ -n "$git_info" ]]; then
prompt_paradox_start_segment green black '${(e)git_info[ref]}${(e)git_info[status]}'
fi
if [[ -n "$python_info" ]]; then if [[ -n "$python_info" ]]; then
prompt_paradox_start_segment white black '${(e)python_info[virtualenv]}' prompt_paradox_start_segment white black '${(e)python_info[virtualenv]}'
fi fi
if [[ -n "$git_info" ]]; then
prompt_paradox_start_segment green black '${(e)git_info[ref]}${(e)git_info[status]}'
fi
prompt_paradox_end_segment prompt_paradox_end_segment
} }
@ -101,13 +102,17 @@ function prompt_paradox_precmd {
git-info git-info
fi fi
# Get Python environment information
if (( $+functions[python-info] )); then
python-info
fi
# Calculate and print the elapsed time. # Calculate and print the elapsed time.
prompt_paradox_print_elapsed_time prompt_paradox_print_elapsed_time
} }
function prompt_paradox_preexec { function prompt_paradox_preexec {
_prompt_paradox_start_time="$SECONDS" _prompt_paradox_start_time="$SECONDS"
python-info
} }
function prompt_paradox_setup { function prompt_paradox_setup {
@ -149,7 +154,7 @@ function prompt_paradox_setup {
'status' '%s%D%A%B%S%a%d%m%r%U%u' 'status' '%s%D%A%B%S%a%d%m%r%U%u'
# %v - virtualenv name. # %v - virtualenv name.
zstyle ':prezto:module:python:info:virtualenv' format 'virtualenv:%v' zstyle ':prezto:module:python:info:virtualenv' format '🐍 %v'
# Define prompts. # Define prompts.
PROMPT=' PROMPT='

Loading…
Cancel
Save