From 4d31217b47a813ac3ddb495e82736b9448fe1feb Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Sat, 21 Jun 2025 20:58:36 +0200 Subject: Don't blink git loading status outside of repos --- conf.d/cstar.fish | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/conf.d/cstar.fish b/conf.d/cstar.fish index dc5651a..6ca5a6b 100644 --- a/conf.d/cstar.fish +++ b/conf.d/cstar.fish @@ -98,7 +98,8 @@ 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 -l cwd_is_repo "$(git rev-parse --is-inside-work-tree 2> /dev/null)" + if test "$cwd_is_repo" != "true" set -Ue $_cstar_git_async set -Ue $_cstar_git_cached_pwd end @@ -106,7 +107,11 @@ function cstar_git_query_async --on-event fish_prompt set -l cached_pwd $$_cstar_git_cached_pwd if test "$PWD" != "$cached_pwd" - set -U $_cstar_git_async \ue727 + if test -n "$cwd_is_repo" + set -U $_cstar_git_async \ue727 + else + set -Ue $_cstar_git_async + end end fish --private --command "set -x __fish_git_prompt_show_informative_status 1 && \ -- cgit v1.2.3