|
|
|
@ -57,10 +57,14 @@ function prompt_paradox_build_prompt {
|
|
|
|
|
prompt_paradox_start_segment yellow black '${python_info[ref]}${python_info[virtualenv]}'
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
f [[ -n "${http_proxy}" ]]; then
|
|
|
|
|
prompt_paradox_start_segment blue black 'PROXY'
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
prompt_paradox_end_segment
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function prompt_paradox_pwd {
|
|
|
|
|
|
|
|
|
|
unction prompt_paradox_pwd {
|
|
|
|
|
local pwd="${PWD/#$HOME/~}"
|
|
|
|
|
|
|
|
|
|
if [[ "$pwd" == (#m)[/~] ]]; then
|
|
|
|
@ -69,9 +73,9 @@ function prompt_paradox_pwd {
|
|
|
|
|
else
|
|
|
|
|
_prompt_paradox_pwd="${${${${(@j:/:M)${(@s:/:)pwd}##.#?}:h}%/}//\%/%%}/${${pwd:t}//\%/%%}"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function prompt_paradox_print_elapsed_time {
|
|
|
|
|
|
|
|
|
|
unction prompt_paradox_print_elapsed_time {
|
|
|
|
|
local end_time=$(( SECONDS - _prompt_paradox_start_time ))
|
|
|
|
|
local hours minutes seconds remainder
|
|
|
|
|
|
|
|
|
@ -88,9 +92,9 @@ function prompt_paradox_print_elapsed_time {
|
|
|
|
|
elif (( end_time > 10 )); then
|
|
|
|
|
print -P "%B%F{green}>>> elapsed time ${end_time}s%b"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function prompt_paradox_precmd {
|
|
|
|
|
|
|
|
|
|
unction prompt_paradox_precmd {
|
|
|
|
|
setopt LOCAL_OPTIONS
|
|
|
|
|
unsetopt XTRACE KSH_ARRAYS
|
|
|
|
|
|
|
|
|
@ -109,13 +113,13 @@ function prompt_paradox_precmd {
|
|
|
|
|
|
|
|
|
|
# Calculate and print the elapsed time.
|
|
|
|
|
prompt_paradox_print_elapsed_time
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function prompt_paradox_preexec {
|
|
|
|
|
|
|
|
|
|
unction prompt_paradox_preexec {
|
|
|
|
|
_prompt_paradox_start_time="$SECONDS"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function prompt_paradox_setup {
|
|
|
|
|
|
|
|
|
|
unction prompt_paradox_setup {
|
|
|
|
|
setopt LOCAL_OPTIONS
|
|
|
|
|
unsetopt XTRACE KSH_ARRAYS
|
|
|
|
|
prompt_opts=(cr percent subst)
|
|
|
|
|