Changes

Jump to navigation Jump to search
Line 47: Line 47:     
=== With git branch and timestamp ===
 
=== With git branch and timestamp ===
<source lang="bash">PS1=\[\033[01;31m\]\t \[\033[01;32m\]durrantm \[\033[02;36m\]\h \[\033[01;34m\]`pwd | sed "s#\(/[^/]\{1,\}/[^/]\{1,\}/[^/]\{1,\}/\).*\(/[^/]\{1,\}/[^/]\{1,\}\)/\{0,1\}#\1_\2#g"` \[\033[00;33m\]$(git_branch)\[\033[00m\]\n\$ </source>
+
<source lang="bash">git_branch () {
 +
  git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
 +
}
 +
PS1=\[\033[01;31m\]\t \[\033[01;32m\]durrantm \[\033[02;36m\]\h \[\033[01;34m\]`pwd | sed "s#\(/[^/]\{1,\}/[^/]\{1,\}/[^/]\{1,\}/\).*\(/[^/]\{1,\}/[^/]\{1,\}\)/\{0,1\}#\1_\2#g"` \[\033[00;33m\]$(git_branch)\[\033[00m\]\n\$ </source>
    
== Green prompt with timestamp ==
 
== Green prompt with timestamp ==

Navigation menu