about summary refs log tree commit diff
path: root/.config/zsh/.zshrc
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2021-04-11 10:57:17 -0500
committerStarfall <us@starfall.systems>2021-04-11 10:57:17 -0500
commitc25a49187c143e2bbf10522e5f3b5d5466e41601 (patch)
treeb5622730714b408e02adc580956e38e5ca5c1cf4 /.config/zsh/.zshrc
parent08877cc2308caaafd4acaf8ee4667c93050d3509 (diff)
zsh: fix vcs_prompt_info inside of bare repos and .git directories
Diffstat (limited to '.config/zsh/.zshrc')
-rw-r--r--.config/zsh/.zshrc4
1 files changed, 3 insertions, 1 deletions
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc
index ab639f9..c6c0e89 100644
--- a/.config/zsh/.zshrc
+++ b/.config/zsh/.zshrc
@@ -102,7 +102,9 @@ autoload -Uz vcs_info
 zstyle ':vcs_info:*' enable git
 zstyle ':vcs_info:*' actionformats '%F{purple}[%F{green}%b%F{olive}|%F{red}%a%F{purple}]%f '
 zstyle ':vcs_info:*' formats '%F{purple}[%F{green}%b%F{purple}]%f '
-precmd () { vcs_info }
+precmd () { 
+	[[ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" == "true" ]] && vcs_info || vcs_info_msg_0_=""
+}
 
 user="%n"
 if [[ -n "$SSH_CLIENT" || "$USER" == "root" ]]; then