Skip to content

Instantly share code, notes, and snippets.

@felipecwb
Last active April 11, 2018 21:24
Show Gist options
  • Save felipecwb/f6d8865a7d280eb37da8bdb01abebeb6 to your computer and use it in GitHub Desktop.
Save felipecwb/f6d8865a7d280eb37da8bdb01abebeb6 to your computer and use it in GitHub Desktop.
PS1 bash
# PS1
PROMPT_COMMAND='PWD_ABBREVIATION=$(p="${PWD#${HOME}}"; [ "${PWD}" != "${p}" ] && printf "~";IFS=/; for q in ${p:1}; do printf /${q:0:1}; done; printf "${q:1}")'
export PS1='`if [ $? = 0 ];then echo "\[\033[1;32m\]✔";else echo "\[\033[1;31m\]✘";fi` \[\033[1;34m\]\u\[\033[0m\]@\[\033[1;30m\]\h\[\033[0;33m\] ${PWD_ABBREVIATION}\[\033[0;35m\]$(__git_ps1) \[\033[1;31m\]>\[\033[0m\] '
# PS1
export PS1='`if [ $? = 0 ];then echo "\[\033[1;32m\]✔";else echo "\[\033[1;31m\]✘";fi` \[\033[1;30m\]\u \[\033[1;34m\]\w\[\033[0;35m\]$(__git_ps1) \[\033[1;31m\]>\[\033[0m\] '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment