mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-20 03:13:33 +01:00
Merge 66acf56c25 into 1b6af54676
This commit is contained in:
commit
f81e38f30f
1 changed files with 5 additions and 4 deletions
|
|
@ -26,7 +26,8 @@
|
||||||
# A few utility functions to make it easy and re-usable to draw segmented prompts
|
# A few utility functions to make it easy and re-usable to draw segmented prompts
|
||||||
|
|
||||||
CURRENT_BG='NONE'
|
CURRENT_BG='NONE'
|
||||||
SEGMENT_SEPARATOR=''
|
SEGMENT_SEPARATOR='\ue0b0'
|
||||||
|
|
||||||
|
|
||||||
# Begin a segment
|
# Begin a segment
|
||||||
# Takes two arguments, background and foreground. Both can be omitted,
|
# Takes two arguments, background and foreground. Both can be omitted,
|
||||||
|
|
@ -74,9 +75,10 @@ prompt_git() {
|
||||||
dirty=$(parse_git_dirty)
|
dirty=$(parse_git_dirty)
|
||||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)"
|
ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)"
|
||||||
if [[ -n $dirty ]]; then
|
if [[ -n $dirty ]]; then
|
||||||
prompt_segment yellow black
|
prompt_segment red black
|
||||||
else
|
else
|
||||||
prompt_segment green black
|
prompt_segment green black
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -e "${repo_path}/BISECT_LOG" ]]; then
|
if [[ -e "${repo_path}/BISECT_LOG" ]]; then
|
||||||
|
|
@ -86,7 +88,6 @@ prompt_git() {
|
||||||
elif [[ -e "${repo_path}/rebase" || -e "${repo_path}/rebase-apply" || -e "${repo_path}/rebase-merge" || -e "${repo_path}/../.dotest" ]]; then
|
elif [[ -e "${repo_path}/rebase" || -e "${repo_path}/rebase-apply" || -e "${repo_path}/rebase-merge" || -e "${repo_path}/../.dotest" ]]; then
|
||||||
mode=" >R>"
|
mode=" >R>"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setopt promptsubst
|
setopt promptsubst
|
||||||
autoload -Uz vcs_info
|
autoload -Uz vcs_info
|
||||||
|
|
||||||
|
|
@ -98,7 +99,7 @@ prompt_git() {
|
||||||
zstyle ':vcs_info:*' formats ' %u%c'
|
zstyle ':vcs_info:*' formats ' %u%c'
|
||||||
zstyle ':vcs_info:*' actionformats ' %u%c'
|
zstyle ':vcs_info:*' actionformats ' %u%c'
|
||||||
vcs_info
|
vcs_info
|
||||||
echo -n "${ref/refs\/heads\// }${vcs_info_msg_0_%% }${mode}"
|
echo -n "${ref/refs\/heads\//\ue0a0 }${vcs_info_msg_0_%% }${mode}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue