Browse Source

zsh: add NOGITPS1 variable to disable git in prompt

master
Skia 4 months ago
parent
commit
3e3952c8a1
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      .zsh/functions/prompt_skia_setup

+ 1
- 1
.zsh/functions/prompt_skia_setup View File

@@ -86,7 +86,7 @@ prompt_skia_precmd() {

# Git handling
git status >/dev/null 2>/dev/null
if [ $? = 0 ]; then
if [ $? = 0 ] && [ "$NOGITPS1" = "" ]; then
git_branch=$(git branch 2>/dev/null | grep -e '^*' | sed -E 's/^\* (.+)$/\1/')
git_shortstat=$(git diff --shortstat 2>/dev/null | sed "s/^ \(.\+\) files\? changed\(, \(.\+\) insertions\?(+)\)\?\(, \(.\+\) deletions\?(-)\)\?/%F{black}: \1f %F{green}\3+ %F{red}\5-/")
git_color=$((git status --short --porcelain 2>/dev/null | grep "^??" > /dev/null && echo "%F{red}") ||

Loading…
Cancel
Save