Skip to content

Instantly share code, notes, and snippets.

@brandon-wallace
Last active September 19, 2021 16:17
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Bash Prompt Color Change On Execution
# Add this to your .bashrc file.
count=232;
# Set the prompt to change colors on execution of each command.
function bash_prompt(){
PS1="\033[38;5;${count}m"' \W \$ '"\033[00m"
count=$((count+1));
[ $count -eq 255 ] && count=232;
}
PROMPT_COMMAND=bash_prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment