From c25a49187c143e2bbf10522e5f3b5d5466e41601 Mon Sep 17 00:00:00 2001 From: Starfall Date: Sun, 11 Apr 2021 10:57:17 -0500 Subject: zsh: fix vcs_prompt_info inside of bare repos and .git directories --- .config/zsh/.zshrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit