]> gitweb.fluxo.info Git - puppet-nodo.git/commitdiff
Adding git branch into PS1
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 18 Jul 2013 20:27:45 +0000 (17:27 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 18 Jul 2013 20:27:45 +0000 (17:27 -0300)
files/bin/prompt.sh

index 159ef77a9c68c7ea279528eff8861041661d9444..84112bbd51459318aac95b3d789edce244071ba9 100644 (file)
@@ -30,7 +30,11 @@ function command_prompt() {
     status_color="${COLOR_RED_BOLD}"
   fi
 
-  PS1="(${status_color}${exit_status}${COLOR_NONE}) [${COLOR_RED}\D{%Y%m%d %H:%M:%S}${COLOR_NONE}] ${COLOR_CYAN}${debian_chroot:+($debian_chroot) }${COLOR_NONE}${COLOR_GREEN}\u@\h${COLOR_NONE}:${COLOR_CYAN}\w${COLOR_NONE} \\$ "
+  # Without git completion
+  #PS1="(${status_color}${exit_status}${COLOR_NONE}) [${COLOR_RED}\D{%Y%m%d %H:%M:%S}${COLOR_NONE}] ${COLOR_CYAN}${debian_chroot:+($debian_chroot) }${COLOR_NONE}${COLOR_GREEN}\u@\h${COLOR_NONE}:${COLOR_CYAN}\w${COLOR_NONE} \\$ "
+
+  # With git completion
+  PS1="(${status_color}${exit_status}${COLOR_NONE}) [${COLOR_RED}\D{%Y%m%d %H:%M:%S}${COLOR_NONE}] ${COLOR_CYAN}${debian_chroot:+($debian_chroot) }${COLOR_NONE}${COLOR_GREEN}\u@\h${COLOR_NONE}:${COLOR_CYAN}\w$(__git_ps1 " (%s)")${COLOR_NONE} \\$ "
   PS2="${BOLD}>${OFF} "
 }