2
2
#
3
3
# PS1 magic
4
4
#
5
- # Mostly copied from YUVAL KOGMAN version, added my own __git_ps1 stuff
5
+ # Mostly copied from YUVAL KOGMAN's version, added my own __git_ps1 stuff
6
6
# Original: http://gist.github.com/621452
7
7
#
8
8
# See video demo of this at http://vimeo.com/15789794
@@ -54,17 +54,17 @@ _update_prompt () {
54
54
local u;
55
55
local p;
56
56
if [ " $UID " = " 0" ]; then
57
- u=" $e_bred \u$e_normal " ;
57
+ u=" $e_bred \u$e_normal " ;
58
58
p=" $e_bred #$e_normal " ;
59
59
else
60
- u=" $e_purple \u$e_normal " ;
60
+ u=" $e_purple \u$e_normal " ;
61
61
p=" \$ " ;
62
62
fi
63
63
64
64
# # Color git status if any
65
65
branch=` __git_ps1 " (%s)" `
66
66
if [ -n " $branch " ] ; then
67
- if [ -z " $_dumb_prompt " ]; then
67
+ if [ -z " $_dumb_prompt " ]; then
68
68
# # Assumes that untracked files are always listed after modified ones
69
69
# # True for all git versions I could find
70
70
git status --porcelain | perl -ne ' exit(1) if /^ /; exit(2) if /^[?]/'
@@ -74,12 +74,12 @@ if [ -z "$_dumb_prompt" ]; then
74
74
" 2" ) branch=" $e_byellow$branch$e_normal " ;;
75
75
" 130" ) branch=" $e_white$branch$e_normal " ; _dumb_prompt=1 ;;
76
76
esac
77
- else
78
- branch=" $e_white$branch$e_normal "
77
+ else
78
+ branch=" $e_white$branch$e_normal "
79
79
fi
80
- fi
81
- full_prompt=" $ex$_prompt $u$branch $p " ;
82
- export PS1=" \[\e]0;\u@\h:\w\\ a\]$full_prompt " ;
80
+ fi
81
+ full_prompt=" $ex$_prompt $u$branch $p " ;
82
+ export PS1=" \[\e]0;\u@\h:\w\\ a\]$full_prompt " ;
83
83
}
84
84
85
85
dumb_prompt () {
@@ -91,6 +91,6 @@ smart_prompt () {
91
91
}
92
92
93
93
if [ -n " $PS1 " ] ; then
94
- PROMPT_COMMAND=' _update_prompt'
94
+ PROMPT_COMMAND=' _update_prompt'
95
95
export PROMPT_COMMAND
96
96
fi
0 commit comments