Xenith/activate.zsh
2026-10-04 14:53:45 +07:00

27 lines
812 B
Bash

# activate.zsh
export VIRTUAL_ENV_PROMPT="%F{red}Xenith%f"
alias Xenith='./bin/Xenith'
if [ -z "${_OLD_VIRTUAL_PS1+x}" ]; then
_OLD_VIRTUAL_PS1="$PS1"
fi
PS1="(${VIRTUAL_ENV_PROMPT}) ${_OLD_VIRTUAL_PS1}"
deactivate_custom() {
unalias Xenith 2>/dev/null
unalias deactivate 2>/dev/null
if [ -n "${_OLD_VIRTUAL_PS1+x}" ]; then
PS1="$_OLD_VIRTUAL_PS1"
unset _OLD_VIRTUAL_PS1
fi
if (( $+functions[_old_virtual_deactivate] )); then
_old_virtual_deactivate
elif (( $+functions[deactivate] )); then
builtin deactivate 2>/dev/null || true
fi
unset -f deactivate_custom
compdel Xenith 2>/dev/null
compdel ./bin/Xenith 2>/dev/null
}
alias deactivate='deactivate_custom'
source "${0:A:h}/_xenith"
compdef _xenith Xenith
compdef _xenith ./bin/Xenith