Browse Source

bash: ветка git в приглашении

Maxim Likhachev 5 years ago
parent
commit
55875639c6
  1. 16
      etc/shell/bash/bashrc

16
etc/shell/bash/bashrc

@ -1,6 +1,6 @@
#!/bin/bash #################################################################### #!/bin/bash ####################################################################
# #
# Изменён: вт 18 фев 2020 15:37:12 # Изменён: Вт 18 фев 2020 16:25:24
# #
################################################################################ ################################################################################
@ -180,16 +180,18 @@ else
#export HOME=$HOME #export HOME=$HOME
fi fi
__ps1_git() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/:\1/'
}
PS1_JOBS="${PROMPT_COLOR}┌─(${yellow}\j${PROMPT_COLOR})" PS1_JOBS="${PROMPT_COLOR}┌─(${yellow}\j${PROMPT_COLOR})"
PS1_HOST="─[${yellow}\h${PROMPT_COLOR}]${PROMPT_SHH}" PS1_HOST="─[${yellow}\h${PROMPT_COLOR}]${PROMPT_SHH}"
PS1_CWD="─[${red}${VIFM_SHELL}${yellow}\w${PROMPT_COLOR}]\n" PS1_GIT="${blue}$(__ps1_git)${PROMPT_COLOR}"
PS1_LINE2="\n${PROMPT_COLOR}─[${PROMPT_COLOR}\t]\$ $rstc"
PS1_LINE1="${PS1_JOBS}${PS1_HOST}${PS1_CWD}"
PS1_LINE2="${PROMPT_COLOR}─[${PROMPT_COLOR}\t]\$ $rstc"
PS1="${PS1_LINE1}${PS1_LINE2}" export PS1="${PS1_JOBS}${PS1_HOST}─[${red}${VIFM_SHELL}${yellow}\w${PROMPT_COLOR}${blue}\$(__ps1_git)${PROMPT_COLOR}]${PS1_LINE2}"
unset PS1_JOBS PS1_HOST PS1_CWD PS1_LINE1 PS1_LINE2 unset PS1_JOBS PS1_HOST PS1_LINE1 PS1_LINE2
# }}} ########################################################################## # }}} ##########################################################################
# {{{ Подключение псевдонимов # {{{ Подключение псевдонимов

Loading…
Cancel
Save