niedziela, 4 marca 2012

Mój prompt

By żyło się lepiej czasem trzeba trochę zmienić wygląd promt-a (to co jest przed znakiem zachęty w konsoli):
 if [ "$color_prompt" = yes ]; then                                                                                         
     # Add more info to git branch                                                                                       
     # If changed no commit                                                                                           
     export GIT_PS1_SHOWDIRTYSTATE=true                                                                                     
     # Diff beetwen originy                                                                                           
     export GIT_PS1_SHOWUPSTREAM="verbose"                                                                                   
     # If some file is no track                                                                                         
     export GIT_PS1_SHOWUNTRACKEDFILES=true                                                                                   
     # If somthing is stashed                                                                                          
     export GIT_PS1_SHOWSTASHSTATE=true                                                                                     
     PS1='\[$(tput sgr0)$(tput setaf 5)\]$(__git_ps1 "[%s]")\[$(tput setaf 2)\]\u@\h:\[$(tput sgr0)$(tput setaf 3)\]\w\[$(tput sgr0)\]$ '                                    
     if [ -e /usr/share/terminfo/x/xterm-256color ]; then                                                                            
         export TERM='xterm-256color'                                                                                    
     else                                                                                                    
         export TERM='xterm-color'                                                                                     
     fi                                                                                                     
 else                                                                                                        
     PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '                                                                            
 fi   
Efekt jest następujący:



A w folderze z repozytorium git: 



Czyli świat robi się kolorowy:P


 Więcej informacji o prompt

Brak komentarzy: