diff options
Diffstat (limited to 'prompt')
-rwxr-xr-x | prompt | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -276,8 +276,6 @@ PROMPT_COMMAND=' " ` - - ### OP unset op @@ -325,16 +323,17 @@ PROMPT_COMMAND=' eval git_color="\${git_$status}" ### head - set `git-name-rev HEAD` - head="$2" + head=`git-name-rev --name-only HEAD 2>/dev/null` + head_rev=`git-rev-parse HEAD 2>/dev/null` + head_rev=${head_rev:0:6} ### compose local label [[ $clean == "clean" ]] || sep=":" - tail_local="$head${op+/$op}$sep$git_added$git_added_files$git_modified$git_modified_files$git_untracked$git_untracked_files$git_color" + 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" - ### fringes + ### fringes (added depended on location) head_local="${head_local+$git_color $head_local\n}" - tail_local="${tail_local+$git_color ($tail_local)}${dir_color}" + tail_local="${tail_local+$git_color $tail_local}${dir_color}" unset branch status git_color clean added modified untracked sep unset git_modified_files @@ -346,7 +345,7 @@ PROMPT_COMMAND=' # PS1="$label$rc'$color_who_where$dir_color'${head:10*(${#PWD}<max)}${PWD:(${#PWD}>max)*(${#PWD}-max):max}> '$colors_reset'" - PS1="$head_local$colors_reset$label$rc'$color_who_where$dir_color'\w$tail_local'$dir_color' > '$colors_reset'" + PS1="$head_local$colors_reset$label$rc'$color_who_where$dir_color'\w$tail_local'$dir_color'> '$colors_reset'" unset head_local tail_local ' |