diff --git a/etc/shell/bash/bashrc b/etc/shell/bash/bashrc index 2549002..bbef675 100755 --- a/etc/shell/bash/bashrc +++ b/etc/shell/bash/bashrc @@ -1,6 +1,6 @@ #!/bin/bash #################################################################### # -# Изменён: ср 26 май 2021 11:22:07 +# Изменён: ср 26 май 2021 14:32:40 # ################################################################################ @@ -231,7 +231,7 @@ __prompt_command() { # Сокращение текущей директории. В отличие от PROMPT_DIRTRIM выводит две директории в начале пути local PS1_PWD=$(pwd | sed 's@'$HOME'@~@; s@^\(\([~/][^/]*\)\{2\}/\).*\(\(/[^/]*\)\{2\}\)$@\1...\3@') - local PS1_GIT_USER=$(git user 2> /dev/null | sed -e 's/^/ (/' -e 's/$/)/') + local PS1_GIT_USER=$(git branch &> /dev/null && git user 2> /dev/null | sed -e 's/^/ (/' -e 's/$/)/') local PS1_GIT_BRANCH=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/  \1/') local PS1_PATH="─[\[${red}\]${VIFM_SHELL}\[${yellow}\]${PS1_PWD}\[${PROMPT_COLOR}\]\[${magenta}\]${PS1_GIT_BRANCH}${PS1_GIT_USER}\[${PROMPT_COLOR}\]]"