Codebase list kali-defaults / b998857
integrate virtualenv indicator into custom zsh prompt The zsh prompt looks broken when a virtualenv is activated. This PR adds better support for virtual environments that use the VIRTUAL_ENV environment variable. John Grese 3 years ago
1 changed file(s) with 7 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
5454 debian_chroot=$(cat /etc/debian_chroot)
5555 fi
5656
57 # override default virtualenv indicator in prompt
58 export VIRTUAL_ENV_DISABLE_PROMPT=1
59 venv_info() {
60 [ $VIRTUAL_ENV ] && echo "(%B%F{reset}$(basename $VIRTUAL_ENV)%b%F{%(#.blue.green)})"
61 }
62
5763 # set a fancy prompt (non-color, unless we know we "want" color)
5864 case "$TERM" in
5965 xterm-color|*-256color) color_prompt=yes;;
7682 fi
7783
7884 if [ "$color_prompt" = yes ]; then
79 PROMPT=$'%F{%(#.blue.green)}┌──${debian_chroot:+($debian_chroot)──}(%B%F{%(#.red.blue)}%n%(#.💀.㉿)%m%b%F{%(#.blue.green)})-[%B%F{reset}%(6~.%-1~/…/%4~.%5~)%b%F{%(#.blue.green)}]\n└─%B%(#.%F{red}#.%F{blue}$)%b%F{reset} '
85 PROMPT=$'%F{%(#.blue.green)}┌──${debian_chroot:+($debian_chroot)──}$(venv_info)(%B%F{%(#.red.blue)}%n%(#.💀.㉿)%m%b%F{%(#.blue.green)})-[%B%F{reset}%(6~.%-1~/…/%4~.%5~)%b%F{%(#.blue.green)}]\n└─%B%(#.%F{red}#.%F{blue}$)%b%F{reset} '
8086 RPROMPT=$'%(?.. %? %F{red}%B⨯%b%F{reset})%(1j. %j %F{yellow}%B⚙%b%F{reset}.)'
8187
8288 # enable syntax-highlighting