Skip to content

Instantly share code, notes, and snippets.

@edgabaldi
Last active March 23, 2018 16:24
Show Gist options
  • Save edgabaldi/46b34856d2206425e9a7a5caec2b620f to your computer and use it in GitHub Desktop.
Save edgabaldi/46b34856d2206425e9a7a5caec2b620f to your computer and use it in GitHub Desktop.
function my_beautful_ps1 {
local __path="\[\033[38;5;8m\][\w]\[$(tput sgr0)\]\[\033[38;5;15m\]"
local __git_branch='`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`'
local __end_prompt="\[$(tput sgr0)\]\[\033[38;5;202m\]>\[$(tput sgr0)\]"
export PS1="$__path $__git_branch$__end_prompt "
}
my_beautful_ps1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment