diff options
-rw-r--r-- | .bash/prompt.bash | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/.bash/prompt.bash b/.bash/prompt.bash index 178503a..4c4d068 100644 --- a/.bash/prompt.bash +++ b/.bash/prompt.bash @@ -4,14 +4,14 @@ # ----- PROMPT COLOURS ----- # fgcolor () { #echo "\\[\\033[38;5;"$1"m\\]" - echo "\033[38;5;${1}m" + printf '\033[38;5;%bm' "$1" } fgtcolor () { - echo "\033[38;2;$1;$2;$3m" + printf '\033[38;2;%b;%b;%bm' "$1" "$2" "$3" } bgcolor () { #echo "\\[\\033[48;5;"$1"m\\]" - echo "\033[48;5;${1}m" + printf '\033[48;5;%bm' "$1" } # This is Solaris bash compatible, so we cannot use + here for "at least once) but instead use the # stupid old asterisk (*). Well, here hetting "no digits" practically won't hurt. @@ -167,7 +167,7 @@ __prompt_command() { # of it. We don't like monoliths, we like modules; the latter is good practice. # also, see postexec --> one-time sourcing of git's prompt.sh if command -v __git_ps1 >/dev/null 2>&1;then - GIT_PS1_SHOWCOLORHINTS=1 + GIT_PS1_SHOWCOLORHINTS=1; export GIT_PS1_SHOWCOLORHINTS PS1+="$(__git_ps1 "%s ")" fi if [ "$EXIT" -eq 0 ];then |