diff options
| author | Christoph Schlosser <christoph@linux.com> | 2025-06-21 20:58:36 +0200 |
|---|---|---|
| committer | Christoph Schlosser <christoph@linux.com> | 2025-06-21 20:58:36 +0200 |
| commit | 4d31217b47a813ac3ddb495e82736b9448fe1feb (patch) | |
| tree | 8d5e2a1be94357c38e24050e231975ed0441e98a /conf.d | |
| parent | d2b3f4dea12f298236d74bc18d7656adf37ef609 (diff) | |
| download | c-star-4d31217b47a813ac3ddb495e82736b9448fe1feb.tar.gz | |
Don't blink git loading status outside of repos
Diffstat (limited to 'conf.d')
| -rw-r--r-- | conf.d/cstar.fish | 9 |
1 files 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 && \ |