Skip to content

Instantly share code, notes, and snippets.

@brandon-wallace
Last active April 29, 2024 22:52
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save brandon-wallace/7bb14c4e68235d748493c5da43036461 to your computer and use it in GitHub Desktop.
Save brandon-wallace/7bb14c4e68235d748493c5da43036461 to your computer and use it in GitHub Desktop.
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