Browse Source

bash: ++git user

Maxim Likhachev 4 years ago
parent
commit
b70571b5bf
  1. 4
      etc/shell/bash/bashrc

4
etc/shell/bash/bashrc

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
#!/bin/bash ####################################################################
#
# Изменён: ср 26 май 2021 11:22:07
# Изменён: ср 26 май 2021 14:32:40
#
################################################################################
@ -231,7 +231,7 @@ __prompt_command() { @@ -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}\]]"

Loading…
Cancel
Save