1
+ # shellcheck shell=bash
2
+ # shellcheck disable=SC2034
1
3
# Modified version of the original modern theme in bash-it
2
4
# Removes the battery charge and adds the current time
3
5
4
6
SCM_THEME_PROMPT_PREFIX=" "
5
7
SCM_THEME_PROMPT_SUFFIX=" "
6
8
7
- SCM_THEME_PROMPT_DIRTY=" ${bold_red} ✗${normal} "
8
- SCM_THEME_PROMPT_CLEAN=" ${bold_green} ✓${normal} "
9
- SCM_GIT_CHAR=" ${bold_green} ±${normal} "
10
- SCM_SVN_CHAR=" ${bold_cyan} ⑆${normal} "
11
- SCM_HG_CHAR=" ${bold_red} ☿${normal} "
9
+ SCM_THEME_PROMPT_DIRTY=" ${bold_red? } ✗${normal? } "
10
+ SCM_THEME_PROMPT_CLEAN=" ${bold_green? } ✓${normal? } "
11
+ SCM_GIT_CHAR=" ${bold_green? } ±${normal? } "
12
+ SCM_SVN_CHAR=" ${bold_cyan? } ⑆${normal? } "
13
+ SCM_HG_CHAR=" ${bold_red? } ☿${normal? } "
12
14
13
15
case $TERM in
14
16
xterm* )
22
24
PS3=" >> "
23
25
24
26
is_vim_shell () {
25
- if [ ! -z " $VIMRUNTIME " ]; then
26
- echo " [${cyan} vim shell${normal} ]"
27
+ if [ -n " $VIMRUNTIME " ]; then
28
+ echo " [${cyan? } vim shell${normal? } ]"
27
29
fi
28
30
}
29
31
@@ -33,14 +35,15 @@ modern_current_time_prompt() {
33
35
34
36
prompt () {
35
37
SCM_PROMPT_FORMAT=' [%s][%s]'
36
- if [ $? -ne 0 ]; then
38
+ local last_status=$?
39
+ if [ $last_status -ne 0 ]; then
37
40
# Yes, the indenting on these is weird, but it has to be like
38
41
# this otherwise it won't display properly.
39
42
40
- PS1=" ${TITLEBAR}${bold_red} ┌─${reset_color} $( scm_prompt) $( modern_current_time_prompt) [${cyan} \W${normal} ]$( is_vim_shell)
41
- ${bold_red} └─▪${normal} "
43
+ PS1=" ${TITLEBAR}${bold_red? } ┌─${reset_color? } $( scm_prompt) $( modern_current_time_prompt) [${cyan? } \W${normal? } ]$( is_vim_shell)
44
+ ${bold_red? } └─▪${normal? } "
42
45
else
43
- PS1=" ${TITLEBAR} ┌─$( scm_prompt) $( modern_current_time_prompt) [${cyan} \W${normal} ]$( is_vim_shell)
46
+ PS1=" ${TITLEBAR} ┌─$( scm_prompt) $( modern_current_time_prompt) [${cyan? } \W${normal? } ]$( is_vim_shell)
44
47
└─▪ "
45
48
fi
46
49
}
0 commit comments