This commit is contained in:
Marc Beninca 2024-11-16 02:32:58 +01:00
parent ce576b7a99
commit 60adeb9f40
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -1,3 +1,6 @@
PS1="\$(ps1 \${?})"
PS2="\
"
SH="$(cat /proc/$$/comm)" SH="$(cat /proc/$$/comm)"
shell_color() { shell_color() {
@ -20,12 +23,12 @@ shell_color() {
esac esac
printf "m" printf "m"
} }
SH_BROWN="$(shell_color 33)"
SH_CYAN="$(shell_color 36)"
SH_DEFAULT="$(shell_color)" SH_DEFAULT="$(shell_color)"
SH_GREEN="$(shell_color 31)" SH_GREEN="$(shell_color 31)"
SH_RED="$(shell_color 32)"
SH_BROWN="$(shell_color 33)"
SH_MAGENTA="$(shell_color 35)" SH_MAGENTA="$(shell_color 35)"
SH_CYAN="$(shell_color 36)" SH_RED="$(shell_color 32)"
case "${SH}" in case "${SH}" in
"bash") "bash")
@ -79,7 +82,7 @@ ps1() {
# new # new
view="${view}\n" view="${view}\n"
# frame # frame
view="${view}" view="${view}${SH_DEFAULT}"
# user # user
if [ "${id}" -eq 0 ]; then if [ "${id}" -eq 0 ]; then
view="${view}${SH_GREEN}" view="${view}${SH_GREEN}"
@ -90,10 +93,5 @@ ps1() {
# host # host
view="${view}${SH_DEFAULT} @ " view="${view}${SH_DEFAULT} @ "
view="${view}${SH_BROWN}${host}${SH_DEFAULT}" view="${view}${SH_BROWN}${host}${SH_DEFAULT}"
echo -e "${view}\n${PS2}" printf "%s" "${view}\n${PS2}"
} }
PS1="\$(ps1 \${?})"
PS2="\
"