This commit is contained in:
Dan Ekstrom 2026-05-18 10:08:37 +02:00 committed by GitHub
commit 70ee622c27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 81 additions and 0 deletions

View file

@ -103,6 +103,11 @@ function _omz_git_prompt_status() {
local status_lines
status_lines=("${(@f)${status_text}}")
# Use C locale for regex matching to avoid "illegal byte sequence" errors
# when branch names or file paths contain non-ASCII characters (e.g. Chinese)
local _omz_lc_all=$LC_ALL
LC_ALL=C
# If the tracking line exists, get and parse it
if [[ "$status_lines[1]" =~ "^## [^ ]+ \[(.*)\]" ]]; then
local branch_statuses
@ -126,6 +131,8 @@ function _omz_git_prompt_status() {
fi
done
LC_ALL=$_omz_lc_all
# Display the seen statuses in the order specified
local status_prompt
for status_constant in $status_constants; do