blob: 4deb81e28b20f3ab22d61310066817bf0209bd49 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# enable emacs input mode by default
bindkey -e
# set standard PS1
do_colour() {
local colourise=false
LS_COLORS=
eval "$(dircolors -b)"
if [[ -n ${LS_COLORS:+set} ]]; then
colourise=true
else
unset LS_COLORS
fi
if ${colourise} ; then
if [[ ${EUID} == 0 ]] ; then
PS1='%B%F{white}%m%f%b %B%F{cyan}%~%f%b %B%F{red}%#%f%b '
else
PS1='%n on %B%F{white}%m%f%b %~ %B%F{green}%#%f%b '
fi
else
if [[ ${EUID} == 0 ]] ; then
# show root@ when we don't have colors
PS1='! %n on %m %~ %# '
else
PS1='%n on %m %~ %# '
fi
fi
}
do_colour
unset -f do_colour
|