diff options
author | claw0ry <me@claw0ry.net> | 2024-12-17 14:47:51 +0100 |
---|---|---|
committer | claw0ry <me@claw0ry.net> | 2024-12-17 14:47:51 +0100 |
commit | 6cbba9da7327afa44f068465c2102e31fb86e56d (patch) | |
tree | 17f13c53d179a7df4bf7e0c91bbeb5917a6689da /.bashrc | |
parent | fresh start (diff) |
bashrc: add virtual_env info to prompt
Diffstat (limited to '.bashrc')
-rw-r--r-- | .bashrc | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -41,6 +41,9 @@ export HISTFILESIZE=10000 export HISTCONTROL=ignoreboth # --- PROMPT +__virtual_env_info() { + [ $VIRTUAL_ENV ] && echo "${VIRTUAL_ENV+(${VIRTUAL_ENV##*/})}" +} __ps1() { local branch_color="\e[1;35m" local branch_prompt @@ -59,9 +62,9 @@ __ps1() { case "$TERM" in xterm-color|*-256color) - PS1="\e[01;32m\u@\h\e[00m:\e[01;34m\W $branch_prompt_clr$sign_prompt_clr ";; + PS1="\e[0;33m$(__virtual_env_info)\e[01;32m\u@\h\e[00m:\e[01;34m\W $branch_prompt_clr$sign_prompt_clr ";; *) - PS1="\u@\h:\W $branch_prompt$sign_prompt ";; + PS1="$(__virtual_env_info)\u@\h:\W $branch_prompt$sign_prompt ";; esac } |