From d2c62d9299f647ae271f197915d3105067362b0a Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Thu, 19 Jun 2025 01:05:05 +0200 Subject: Indicate that git status is loading and don't shot git at all if it isn't installed --- conf.d/cstar.fish | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/conf.d/cstar.fish b/conf.d/cstar.fish index d29814f..58e123b 100644 --- a/conf.d/cstar.fish +++ b/conf.d/cstar.fish @@ -31,7 +31,10 @@ function cstar_datetime --on-event fish_prompt --on-event fish_postexec --on-var cstar_colorize cstar_datetime (date "+$cstar_date_format") $cstar_datetime_bg $cstar_datetime_fg end -function cstar_git_query_async --on-event fish_prompt --on-variable PWD --on-variable cstar_git_bg --on-variable cstar_git_fg +function cstar_git_query_async --on-event fish_prompt + if ! command -q git + return + end if test "$(git rev-parse --is-inside-work-tree 2> /dev/null)" != "true" set -Ue $_cstar_git_async set -Ue $_cstar_git_cached_pwd @@ -40,7 +43,7 @@ function cstar_git_query_async --on-event fish_prompt --on-variable PWD --on-var set -l cached_pwd $$_cstar_git_cached_pwd if test "$PWD" != "$cached_pwd" - set -Ue $_cstar_git_async + set -U $_cstar_git_async \ue727 end fish --private --command "set -x __fish_git_prompt_show_informative_status 1 && \ -- cgit v1.2.3