ssh - zsh - show if git branch have unpushed commits -


actually im using modified version of oh zsh theme blinks. show ssh statement optical difference local terminal. show branch , little star if there uncommitted changes in branch.

is possible show there unpushed commitments? maybe little indicator.

# https://github.com/blinks zsh theme  function _prompt_char() {   if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1);     echo "%{%f{blue}%}±%{%f%k%b%}"   else     echo ' '   fi }  case ${solarized_theme:-dark} in     light) bkg=white;;     *)     bkg=black;; esac  zsh_theme_git_prompt_prefix=" [%{%b%f{blue}%}" zsh_theme_git_prompt_suffix="%{%f%k%b%k{${bkg}}%b%f{green}%}]" zsh_theme_git_prompt_dirty=" %{%f{red}%}*%{%f%k%b%}" zsh_theme_git_prompt_clean=""  prompt='%{%f%k%b%}  %{%k{black}%b%f{green}%}%n%{%b%f{blue}%}@%{%b%f{cyan}%}%m%{%b%f{green}%} %{%b%f{red}%}!!ssh!! %{%b%f{yellow}%k{black}%}%~%{%b%f{green}%}$(git_prompt_info)%e%{%f%k%b%} %{%k{black}%}$(_prompt_char)%{%k{black}%} %#%{%f%k%b%} '  rprompt='!%{%b%f{cyan}%}%!%{%f%k%b%}' 

thanks in advance denym

you should use vcs_info module come zsh.

there detail tutorial shows how it: http://arjanvandergaag.nl/blog/customize-zsh-prompt-with-vcs-info.html

normally need have ${vcs_info_msg_0_} in $prompt variable after load vcs_info module, can customized prompt format if don't default one.

btw, vcs_info, name has suggested, support other vcss, e.g. svn, hg, cvs, etc.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -