From 1ccfaed4770a533119e70b4aaec746caa082873b Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Fri, 25 Aug 2017 10:30:25 +0200 Subject: [PATCH] completely disable the vcs prompt on network filesystems --- .zsh/themes/prompt_madduck_setup | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.zsh/themes/prompt_madduck_setup b/.zsh/themes/prompt_madduck_setup index 100ce87..3f0f3e5 100644 --- a/.zsh/themes/prompt_madduck_setup +++ b/.zsh/themes/prompt_madduck_setup @@ -141,6 +141,11 @@ __vcs_get_repo_type() { emulate -L zsh # return the type of the closest repository in the path hierarchy + # unless we're on a network filesystem: + if __on_networkfs; then + echo netfs + return + fi local dir while true; do [ -d ${dir}.git ] && echo git && break @@ -259,7 +264,7 @@ __vcs_set_prompt_variables() ;; *) case "$repotype" in - NONE) :;; + NONE|netfs) :;; *) warn "$repotype repositories not (yet) supported in the prompt";; esac local MAXLEN MINLEN @@ -293,9 +298,11 @@ if ! is_root; then _update_vcs_prompt_vars_if_vcs_ran() { local vcs="$(__vcs_get_repo_type)" - case "$(history $(($HISTCMD - 1)))" in + case "$vcs/$(history $(($HISTCMD - 1)))" in # $vcs appeared in last command, so be sure to update - *${vcs}*) __vcs_set_prompt_variables "$vcs" + NONE/*) :;; + netfs/*) :;; + */*${vcs}*) __vcs_set_prompt_variables "$vcs" esac } add-zsh-hook precmd _update_vcs_prompt_vars_if_vcs_ran -- 2.39.2