From d4cdb8c3cd0ca0c179a5646bed1a3ee85bbd47b9 Mon Sep 17 00:00:00 2001 From: Tharre Date: Sat, 2 Mar 2019 14:57:19 +0100 Subject: zsh: ignore git error in prompt function Avoids errors like this one after every command: warning: could not open directory 'pkg/': Permission denied --- .zsh/prompt_custom_setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zsh/prompt_custom_setup b/.zsh/prompt_custom_setup index 1fd02c4..262777a 100644 --- a/.zsh/prompt_custom_setup +++ b/.zsh/prompt_custom_setup @@ -11,7 +11,7 @@ function prompt_print_hostname() { function git_prompt_parse_dirty() { local FLAGS=("--porcelain" "--ignore-submodules=dirty") - local STATUS=$(command git status $FLAGS | tail -n1) + local STATUS=$(command git status $FLAGS 2> /dev/null | tail -n1) if [[ -n $STATUS ]]; then printf "%s" "%F{214}*%f" fi -- cgit v1.2.3-70-g09d2