Make your bash prompt dynamically and randomly rainbow
rainbow-bash-prompt makes your bash prompt rainbow by using dosentmatter/lolcat.
If you are looking for a rainbow prompt for zsh, check out dosentmatter/rainbow-zsh-prompt
Tested on macOS Sierra (Terminal and iTerm2) and Ubuntu (GNOME Terminal)
$PATH
and name it lolcat-c
.bash_prompt
to your $HOME
directory.bashrc
:if [[ -f ~/.bash_prompt ]]; then
. ~/.bash_prompt
fi
PS1_DEBUG
to 'true'
or 'false'
. Debugging is used to show the non-printing characters and highlight them. It has a line wrap issue as shown in the asciinema recording above that seems to be caused by colored prompts that are too long. This is not an issue because it is only meant for debugging.PS1
by setting PS1_COLORIZE_COMMAND
to a name of a function.
'__ps1_lolcat'
which uses lolcat-c
for speed.PS1_COLORIZE_COMMAND
to '__ps1_lolcat_ruby'
or '__ps1_lolcat_python'
PS1_DEBUG_COMMAND
to a name of a function.
__ps1_debug
which displays non-printing characters and colors them.To have double quotes "
and backslashes \
work in both regular and debug mode, PS1 has to have \\"
and \\\\
respectively to have the right number of escapes for both modes.