ksh/.kshrc.d/99-prompt.ksh (view raw)
1set -o emacs
2
3red="\033[31m"
4grn="\033[32m"
5ylw="\033[33m"
6cyn="\033[36m"
7blu="\033[34m"
8prp="\033[35m"
9bprp="\033[35;1m"
10gry="\033[94m"
11rst="\033[0m"
12
13prompt_pwd() {
14 printf '%b' "\001${cyn}\002$(pwd)\001${rst}\002"
15}
16
17rootornot() {
18 [[ "$(id -u)" -eq 0 ]] &&
19 printf '%b' "\001${red}\002#\001${rst}\002"
20}
21
22PS1='\n$(prompt_pwd)\n▲$(rootornot) '
23PS2="> "
24