git prompt details implemented

This commit is contained in:
Dirk Alders 2023-09-30 09:31:45 +02:00
parent 117730b82c
commit af0d0bd59c
2 changed files with 7 additions and 2 deletions

View File

@ -30,9 +30,14 @@ configure_prompt() {
[ "$EUID" -eq 0 ] && prompt_symbol='%F{white}☠%B%F{%(#.red.blue)}' [ "$EUID" -eq 0 ] && prompt_symbol='%F{white}☠%B%F{%(#.red.blue)}'
case "$PROMPT_ALTERNATIVE" in case "$PROMPT_ALTERNATIVE" in
twoline) twoline)
PROMPT=$'%F{%(#.blue.green)}┌──${debian_chroot:+($debian_chroot)─}${VIRTUAL_ENV:+($(basename $VIRTUAL_ENV))─}(%B%F{%(#.red.blue)}%n'$prompt_symbol$'%m%b%F{%(#.blue.green)})-[%B%F{reset}%(6~.%-1~/…/%4~.%5~)%b%F{%(#.blue.green)}]\n`giti -n`%F{%(#.blue.green)}└─%B%(#.%F{red}#.%F{blue}$)%b%F{reset} ' export GIT_PROMPT_DETAILS="off"
PROMPT=$'%F{%(#.blue.green)}┌──${debian_chroot:+($debian_chroot)─}${VIRTUAL_ENV:+($(basename $VIRTUAL_ENV))─}(%B%F{%(#.red.blue)}%n'$prompt_symbol$'%m%b%F{%(#.blue.green)})-[%B%F{reset}%(6~.%-1~/…/%4~.%5~)%b%F{%(#.blue.green)}]\n`giti -p`%F{%(#.blue.green)}└─%B%(#.%F{red}#.%F{blue}$)%b%F{reset} '
# Right-side prompt with exit codes and background processes # Right-side prompt with exit codes and background processes
RPROMPT=$'%(?.. %? %F{red}%B⚡%b%F{reset})%(1j. %j %F{yellow}%B⚙%b%F{reset}.)' RPROMPT=$'%(?.. %? %F{red}%B⚡%b%F{reset})%(1j. %j %F{yellow}%B⚙%b%F{reset}.)'
# Add mechanism to switch git details for prompt
gitp() {
[[ "$GIT_PROMPT_DETAILS" == "on" ]] && export GIT_PROMPT_DETAILS="off" || export GIT_PROMPT_DETAILS="on"
}
;; ;;
oneline) oneline)
PROMPT=$'${debian_chroot:+($debian_chroot)}${VIRTUAL_ENV:+($(basename $VIRTUAL_ENV))}%B%F{%(#.red.blue)}%n@%m%b%F{reset}:%B%F{%(#.blue.green)}%~%b%F{reset}%(#.#.$) ' PROMPT=$'${debian_chroot:+($debian_chroot)}${VIRTUAL_ENV:+($(basename $VIRTUAL_ENV))}%B%F{%(#.red.blue)}%n@%m%b%F{reset}:%B%F{%(#.blue.green)}%~%b%F{reset}%(#.#.$) '

2
bin

@ -1 +1 @@
Subproject commit bb3fb18730e1579db828f574d85e0d6ca18d8039 Subproject commit 7354bb9e3a2555bd95d67480846cfadcac009059