Skip to content

Instantly share code, notes, and snippets.

@incanus
Created October 24, 2013 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save incanus/7143758 to your computer and use it in GitHub Desktop.
Save incanus/7143758 to your computer and use it in GitHub Desktop.
NO_COLOR="\[\e[0m\]"
LIGHT_GRAY="\[\e[30;1m\]"
RED="\[\e[0;31m\]"
__user_and_host="$NO_COLOR\u$LIGHT_GRAY@$NO_COLOR\H"
__date_and_time="$NO_COLOR\d$LIGHT_GRAY|$NO_COLOR\T"
__git_branch='$(__git_ps1 "%s")'
__working_path="$NO_COLOR\w"
__prompt_symbol="$NO_COLOR\$"
PS1="$LIGHT_GRAY--($__user_and_host$LIGHT_GRAY)--($__date_and_time$LIGHT_GRAY)--($RED$__git_branch$LIGHT_GRAY)--- -- -\n$LIGHT_GRAY--($__working_path$LIGHT_GRAY)--($__prompt_symbol "
export PS1
@incanus
Copy link
Author

incanus commented Oct 24, 2013

This ends up looking like this normally:

And like this in a Git working copy:

This has username, hostname, date, time, Git branch, current directory, and $ or # depending on superuser status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment