wip/works

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

View file

@ -7,13 +7,13 @@ shell_color() {
local code="${1}" local code="${1}"
case "${SH}" in case "${SH}" in
"bash") "bash")
printf "\e[0" printf "\\e[0"
if [ -n "${code}" ]; then if [ -n "${code}" ]; then
printf "%s" ";${code}" printf "%s" ";${code}"
fi fi
;; ;;
*) *)
printf "\033[" printf "\\033["
if [ -n "${code}" ]; then if [ -n "${code}" ]; then
printf "%s" "${code}" printf "%s" "${code}"
else else
@ -76,11 +76,13 @@ ps1() {
fi fi
fi fi
# new # new
view="${view}\n" view="${view}
"
# path # path
view="${view}${SH_CYAN}${path}" view="${view}${SH_CYAN}${path}"
# new # new
view="${view}\n" view="${view}
"
# frame # frame
view="${view}${SH_DEFAULT}" view="${view}${SH_DEFAULT}"
# user # user
@ -92,6 +94,12 @@ ps1() {
view="${view}${user}" view="${view}${user}"
# host # host
view="${view}${SH_DEFAULT} @ " view="${view}${SH_DEFAULT} @ "
view="${view}${SH_BROWN}${host}${SH_DEFAULT}" view="${view}${SH_BROWN}${host}"
printf "%s" "${view}\n${PS2}" # new
view="${view}
"
# prompt
view="${view}${SH_DEFAULT}${PS2}"
# print
printf "%s" "${view}"
} }