From 82c1e621dd7c00246b8e9301144bdb5c13cb0f73 Mon Sep 17 00:00:00 2001 From: Von Random Date: Thu, 31 Jan 2019 15:45:11 +0300 Subject: [PATCH] avoid printing anything in git status until git status is properly finished --- zshrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zshrc b/zshrc index 606d862..a224d12 100644 --- a/zshrc +++ b/zshrc @@ -98,7 +98,8 @@ precmd.is_git_repo() { precmd.git() { precmd.is_git_repo || return 0 - local raw_status="$(flock -w 1 $prompt_state_file git --no-optional-locks status --porcelain -bu 2>/dev/null)" + local raw_status="$(flock -w 0 $prompt_state_file git --no-optional-locks status --porcelain -bu 2>/dev/null)" + [[ -n $raw_status ]] || return 0 local branch_info full_status git_status= IFS= local staged_count=0 unstaged_count=0 untracked_count=0 unmerged_count=0