diff --git a/lib/git.zsh b/lib/git.zsh index 3a03dbd4d..fae631835 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -42,6 +42,10 @@ function _omz_git_prompt_info() { function _omz_git_prompt_status() { [[ "$(__git_prompt_git config --get oh-my-zsh.hide-status 2>/dev/null)" = 1 ]] && return + # Use C locale for regex operations to avoid "illegal byte sequence" errors + # when branch names contain non-ASCII characters (e.g. Chinese, Japanese) + local LC_ALL=C + # Maps a git status prefix to an internal constant # This cannot use the prompt constants, as they may be empty local -A prefix_constant_map @@ -162,13 +166,13 @@ if zstyle -t ':omz:alpha:lib:git' async-prompt \ # or any of the other prompt variables function _defer_async_git_register() { # Check if git_prompt_info is used in a prompt variable - case "${PS1}:${PS2}:${PS3}:${PS4}:${RPROMPT}:${RPS1}:${RPS2}:${RPS3}:${RPS4}" in + case "${PS1:-}:${PS2:-}:${PS3:-}:${PS4:-}:${RPROMPT:-}:${RPS1:-}:${RPS2:-}:${RPS3:-}:${RPS4:-}" in *(\$\(git_prompt_info\)|\`git_prompt_info\`)*) _omz_register_handler _omz_git_prompt_info ;; esac - case "${PS1}:${PS2}:${PS3}:${PS4}:${RPROMPT}:${RPS1}:${RPS2}:${RPS3}:${RPS4}" in + case "${PS1:-}:${PS2:-}:${PS3:-}:${PS4:-}:${RPROMPT:-}:${RPS1:-}:${RPS2:-}:${RPS3:-}:${RPS4:-}" in *(\$\(git_prompt_status\)|\`git_prompt_status\`)*) _omz_register_handler _omz_git_prompt_status ;; diff --git a/plugins/colorize/colorize.plugin.zsh b/plugins/colorize/colorize.plugin.zsh index c49acd864..68b620b82 100644 --- a/plugins/colorize/colorize.plugin.zsh +++ b/plugins/colorize/colorize.plugin.zsh @@ -90,6 +90,7 @@ colorize_less() { # (e.g. when not scrolled to the bottom) while already the next file will be displayed. local LESSOPEN="| zsh -c 'source \"$ZSH_COLORIZE_PLUGIN_PATH\"; \ ZSH_COLORIZE_TOOL=$ZSH_COLORIZE_TOOL ZSH_COLORIZE_STYLE=$ZSH_COLORIZE_STYLE \ + ZSH_COLORIZE_CHROMA_FORMATTER=$ZSH_COLORIZE_CHROMA_FORMATTER \ colorize_cat %s 2> /dev/null'" # LESSCLOSE will be set to prevent any errors by executing a user script diff --git a/plugins/globalias/globalias.plugin.zsh b/plugins/globalias/globalias.plugin.zsh index bd27d589d..693f4f73b 100644 --- a/plugins/globalias/globalias.plugin.zsh +++ b/plugins/globalias/globalias.plugin.zsh @@ -3,9 +3,13 @@ globalias() { # (z) splits into words using shell parsing # (A) makes it an array even if there's only one element local word=${${(Az)LBUFFER}[-1]} - if [[ $GLOBALIAS_FILTER_VALUES[(Ie)$word] -eq 0 ]]; then - zle _expand_alias - zle expand-word + # Don't expand if the word looks like an environment variable assignment + # (e.g. DEBUG=1 or KEY="value") to avoid expanding aliases in env vars + if [[ $word != *"="* ]]; then + if [[ $GLOBALIAS_FILTER_VALUES[(Ie)$word] -eq 0 ]]; then + zle _expand_alias + zle expand-word + fi fi zle self-insert }