Skip to content

Instantly share code, notes, and snippets.

@captainsafia
Created May 26, 2017 13:58
Show Gist options
  • Save captainsafia/2754fc8c67fcfd45759b48902b0f0b73 to your computer and use it in GitHub Desktop.
Save captainsafia/2754fc8c67fcfd45759b48902b0f0b73 to your computer and use it in GitHub Desktop.
Set different parts of your command prompt with different random colors
# Prints username@hostname working-directory>
function prompt_party {
PS1="\[\033[38;5;$(jot -r 1 1 256)m\]\u\[\033[00m\]"
PS1="$PS1\[\033[38;5;$(jot -r 1 1 256)m\]@\[\033[00m\]"
PS1="$PS1\[\033[38;5;$(jot -r 1 1 256)m\]\h\[\033[00m\] "
PS1="$PS1\[\033[38;5;$(jot -r 1 1 256)m\]\w\[\033[00m\]> "
}
PROMPT_COMMAND=prompt_party
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment