summaryrefslogtreecommitdiff
path: root/lib/git.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/git.zsh')
-rw-r--r--lib/git.zsh16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/git.zsh b/lib/git.zsh
index 0efff3e07..a1b4d1587 100644
--- a/lib/git.zsh
+++ b/lib/git.zsh
@@ -44,6 +44,7 @@ function _omz_git_prompt_info() {
# - 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
+local _style
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() {
@@ -81,6 +82,21 @@ if zstyle -t ':omz:alpha:lib:git' async-prompt \
# Register the async handler first. This needs to be done before
# the async request prompt is run
precmd_functions=(_defer_async_git_register $precmd_functions)
+elif zstyle -s ':omz:alpha:lib:git' async-prompt _style && [[ $_style == "force" ]]; then
+ function git_prompt_info() {
+ if [[ -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_info]}" ]]; then
+ echo -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_info]}"
+ fi
+ }
+
+ function git_prompt_status() {
+ if [[ -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]}" ]]; then
+ echo -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]}"
+ fi
+ }
+
+ _omz_register_handler _omz_git_prompt_info
+ _omz_register_handler _omz_git_prompt_status
else
function git_prompt_info() {
_omz_git_prompt_info