Skip to content

Instantly share code, notes, and snippets.

@PedroRajao
Created September 25, 2019 12:44
Show Gist options
  • Save PedroRajao/e4f89f369b40e7f1da0ed29a47392a64 to your computer and use it in GitHub Desktop.
Save PedroRajao/e4f89f369b40e7f1da0ed29a47392a64 to your computer and use it in GitHub Desktop.
Show Currrent Branch at Terminal
# Instructions
# sudo nano ~/.bashrc
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
# PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
PS1='\[\033[0;37m\][\t]\[\033[0;32m\][\u]\[\033[32m\][\h]\[\033[33m\][`(git branch 2>/dev/null | grep '^*' | colrm 1 2)`] \[\033[1;33m\]\w\a\[\033[0m\]\n\$ '
;;
*)
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment