My ~/.bash_profile
contains this:
function rgb {
# https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
let "sum = 16 + 36*$1 + 6*$2 + $3"
# echo "\[\e[${sum}m\]"
tput setaf ${sum}
}
BOLD=$(tput bold)
DIM=$(tput dim)
RESET=$(tput sgr0)
BRIGHT=$(rgb 5 5 5)
BLUE=$(rgb 1 1 5)
YELLOW=$(rgb 4 4 1)
PS1="\n"
PS1+="\[${DIM}\]"
PS1+="\u@"
PS1+="\[${BRIGHT}\]"
PS1+="\h "
PS1+="\[${BLUE}\]"
PS1+="\w "
PS1+="\[${YELLOW}\]"
PS1+="\$(git_branch)"
PS1+="\n"
PS1+="\[${BRIGHT}\]"
PS1+="> "
PS1+="\[${BOLD}\]"
echo ${BOLD}
If I just execute the above as a separate foo.sh
file, it leaves my bash window dim:
(Edit: Screenshot fail, . foo.sh
behaves the same)
Even upgrading my bash version thru Homebrew fails to shift this.
What's going on?