diff options
Diffstat (limited to 'prompt')
-rwxr-xr-x | prompt | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -321,6 +321,7 @@ PROMPT_COMMAND=' # at least one should be set : ${status?prompt internal error: git status} eval git_color="\${git_$status}" + git_color=${git_color:-$WHITE} ### head head=`git-name-rev --name-only HEAD 2>/dev/null` @@ -328,14 +329,20 @@ PROMPT_COMMAND=' head_rev=${head_rev:0:6} ### compose local label - [[ $clean == "clean" ]] || sep=":" - tail_local="($head $white$head_rev${op+ / $op}$git_color)$sep$git_added$git_added_files$git_modified$git_modified_files$git_untracked$git_untracked_files$git_color" + + unset file_list + file_list+="${git_added_files+$git_added$git_added_files }" + file_list+="${git_modified_files+$git_modified$git_modified_files }" + file_list+="${git_untracked_files+$git_untracked$git_untracked_files }" + [[ $file_list ]] && file_list=":${file_list}" # ${+ does not works (?) + + tail_local="($head $white$head_rev${op+ / $op}$git_color)${file_list}" ### fringes (added depended on location) head_local="${head_local+$git_color $head_local\n}" tail_local="${tail_local+$git_color $tail_local}${dir_color}" - unset branch status git_color clean added modified untracked sep + unset branch status git_color clean added modified untracked sep file_list unset git_modified_files unset git_untracked_files unset git_added_files |