From b6cf913244f2b5d7767ead734078df27e6f0c773 Mon Sep 17 00:00:00 2001 From: tDwtp Date: Thu, 11 Dec 2025 13:47:52 +0100 Subject: [PATCH] fix(git): git_status_prompt must respects spaces to properly match prefixes `git_status_prompt` was always empty as whitespace around the keys for `$prefix_constant_map` were trimmed. The in list of the for loop must be enclosed in `"` to avoid trimming, which in return requires the iterator specifier to contain an `@` to avoid concatenation of all keys. This is important for the regex to work properly. --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index f4d4229cb..8d38f3268 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -117,7 +117,7 @@ function _omz_git_prompt_status() { fi # For each status prefix, do a regex comparison - for status_prefix in ${(k)prefix_constant_map}; do + for status_prefix in "${(@k)prefix_constant_map}"; do local status_constant="${prefix_constant_map[$status_prefix]}" local status_regex=$'(^|\n)'"$status_prefix"