@@ -52,18 +52,24 @@ alias la='ls -AF'
52
52
for c in {e,f,}grep {v,}dir ls; do alias $c =" $c --color=auto" ; done ;
53
53
54
54
# So they can be unset.
55
+ # I need someone to help me assign those names properly.
56
+ # Those are actually bold colors.
55
57
_aosc_bashrc_colors=' NORMAL RED GREEN CYAN IRED YELLOW'
56
- NORMAL=$' \\ [\e [0m\\ ]'
57
- RED=$' \\ [\e [1;31m\\ ]'
58
- GREEN=$' \\ [\e [1;32m\\ ]'
59
- CYAN=$' \\ [\e [1;36m\\ ]'
60
-
61
- # Linux tty color workaround
62
- if [[ " $TERM " == linux ]]; then # && "$(tput colors)" == 8
63
- YELLOW=$' \\ [\e [1;33m' IRED=$' \\ [\e [0;31m\\ ]'
58
+ NORMAL=' \e[0m'
59
+ RED=' \e[1;31m'
60
+ GREEN=' \e[1;32m'
61
+ CYAN=' \e[1;36m'
62
+ YELLOW=' \e[1;93m'
63
+ IRED=' \e[0;91m'
64
+
65
+ if _rc_term_colors=" $( tput colors & > /dev/null) " ; then
66
+ [ " $colors " -le 16 ]
64
67
else
65
- YELLOW=$' \\ [\e [1;93m' IRED=$' \\ [\e [0;91m\\ ]'
66
- fi
68
+ case " $TERM " in (linux|msys|cygwin) true ;; (* ) false ;; esac
69
+ fi && YELLOW=' \e[1;33m' IRED=' \e[0;31m'
70
+ unset _rc_term_colors
71
+
72
+ # if our TERM has no color support, then unset $_aosc_bashrc_colors
67
73
68
74
# A simple error level reporting function.
69
75
# Loaded back to PS1
@@ -95,9 +101,9 @@ type _vcs_status &>/dev/null || ! echo _vcs_status not declared, making stub.. |
95
101
# Well, forget it.
96
102
97
103
if [[ " $EUID " == 0 ]] ; then
98
- PS1=" $RED \u $NORMAL [ \W\$ (_vcs_status) ]$RED \$ (_ret_prompt) $NORMAL "
104
+ PS1=" \[ $RED \]\u \[ $NORMAL \] [ \W\$ (_vcs_status) ]\[ $RED \] \$ (_ret_prompt) \[ $NORMAL \] "
99
105
else
100
- PS1=" $GREEN \u $NORMAL [ \W\$ (_vcs_status) ]$GREEN \$ (_ret_prompt) $NORMAL "
106
+ PS1=" \[ $GREEN \]\u \[ $NORMAL \] [ \W\$ (_vcs_status) ]\[ $GREEN \] \$ (_ret_prompt) \[ $NORMAL \] "
101
107
fi
102
108
103
109
@@ -110,7 +116,7 @@ _is_posix || which --version | grep GNU &>/dev/null && alias which='(alias; decl
110
116
111
117
# Misc stuffs
112
118
FIGNORE=' ~'
113
- TIMEFORMAT=$ '\n real\t %3lR\t %P%%\n user\t %3lU\n sys\t %3lS'
119
+ TIMEFORMAT=' \nreal\t%3lR\t%P%%\nuser\t%3lU\nsys\t%3lS'
114
120
115
121
unset script shopt
116
122
# End /etc/bashrc
0 commit comments