Notes

Set Coloured Prompt in Bash

Daniel Weibel
Created 16 Oct 2015
Last updated 1 Apr 2017

Use in ~/.bashrc (sourced by each non-login shell):

red='\e[1;31m'
green='\e[1;32m'
yellow='\e[1;33m'
blue='\e[1;34m'
purple='\e[1;35m'
cyan='\e[1;36m'
white='\e[1;37m'

reset='\e[0m'

PS1=${green}${PS1}${reset}

Test if terminal supports italic text:

echo -e "\e[3m foo \e[23m"