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