Skip to content

Instantly share code, notes, and snippets.

@android10
Created December 15, 2017 22:04
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save android10/233ab746859f16a3dbac64e8add46cce to your computer and use it in GitHub Desktop.
Save android10/233ab746859f16a3dbac64e8add46cce to your computer and use it in GitHub Desktop.
Fancy prompt with git branch support
# Fancy Terminal Prompt ----------------------------------------------------------
txtcyn=$'\e[0;36m' # Cyan
txtred=$'\e[0;31m' # Red
txtwht=$'\e[0;37m' # White
txtrst=$'\e[0m' # Text Reset
function parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\033[01;33m\]@\u \[\033[01;34m\]\W\[$txtcyn\]\$(parse_git_branch) \[$txtrst\]\$ "
# --------------------------------------------------------------------------------
@android10
Copy link
Author

prompt

@android10
Copy link
Author

android10 commented Dec 15, 2017

In Linux using Gogh to customize the Terminal theme (in this case ACI):
https://github.com/Mayccoll/Gogh

aci

@android10
Copy link
Author

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