@ -39,8 +39,13 @@ function _omz_git_prompt_info() {
echo " ${ ZSH_THEME_GIT_PROMPT_PREFIX } ${ ref : gs /%/%% } ${ upstream : gs /%/%% } $( parse_git_dirty) ${ ZSH_THEME_GIT_PROMPT_SUFFIX } "
echo " ${ ZSH_THEME_GIT_PROMPT_PREFIX } ${ ref : gs /%/%% } ${ upstream : gs /%/%% } $( parse_git_dirty) ${ ZSH_THEME_GIT_PROMPT_SUFFIX } "
}
}
# Use async version if setting is enabled or undefined
# Use async version if setting is enabled, or unset but zsh version is at least 5.0.6.
if zstyle -T ':omz:alpha:lib:git' async-prompt; then
# This avoids async prompt issues caused by previous zsh versions:
# - https://github.com/ohmyzsh/ohmyzsh/issues/12331
# - https://github.com/ohmyzsh/ohmyzsh/issues/12360
# TODO(2024-06-12): @mcornella remove workaround when CentOS 7 reaches EOL
if zstyle -t ':omz:alpha:lib:git' async-prompt \
|| { is-at-least 5.0.6 && zstyle -T ':omz:alpha:lib:git' async-prompt } ; then
function git_prompt_info( ) {
function git_prompt_info( ) {
if [ [ -n " ${ _OMZ_ASYNC_OUTPUT [_omz_git_prompt_info] } " ] ] ; then
if [ [ -n " ${ _OMZ_ASYNC_OUTPUT [_omz_git_prompt_info] } " ] ] ; then
echo -n " ${ _OMZ_ASYNC_OUTPUT [_omz_git_prompt_info] } "
echo -n " ${ _OMZ_ASYNC_OUTPUT [_omz_git_prompt_info] } "