Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to update ZSH_THEME_GIT_PROMPT_PREFIX when git status changed? #12335

Closed
crazytaxi824 opened this issue Apr 8, 2024 · 4 comments
Closed
Assignees

Comments

@crazytaxi824
Copy link

Describe the bug

It is possible to change ZSH_THEME_GIT_PROMPT_PREFIX based on git_current_branch or parse_git_dirty functions before. After omz update, it seems no way to make it work.

Steps to reproduce

none

Expected behavior

change ZSH_THEME_GIT_PROMPT_PREFIX based on git_current_branch or parse_git_dirty functions before.

Screenshots and recordings

No response

OS / Linux distribution

macOS 14.4

Zsh version

5.9

Terminal emulator

Alacritty

If using WSL on Windows, which version of WSL

None

Additional context

No response

@carlosala
Copy link
Member

Hi! I can change as expected my ZSH_THEME_GIT_PROMPT_PREFIX. Which value are you trying to set, and which theme are you using?

@carlosala carlosala self-assigned this Apr 8, 2024
@crazytaxi824
Copy link
Author

Hi, I am trying to change ZSH_THEME_GIT_PROMPT_PREFIX based on $(git_current_branch).

function branch_color() {
  local current_branch=$(git_current_branch)

  if [[ $current_branch == master || $current_branch == main  ]]; then
    ZSH_THEME_GIT_PROMPT_PREFIX="%K{196}%F{15} %B"
  else
    ZSH_THEME_GIT_PROMPT_PREFIX="%K{35}%F{234} "
  fi
}

Without zstyle ':omz:alpha:lib:git' async-prompt no, it is not working.

Thanks.

@carlosala
Copy link
Member

Hi! That's a duplicate of #12328.
We're already working on a fix!
You can see the workaround here!#12328 (comment)

@carlosala carlosala closed this as not planned Won't fix, can't repro, duplicate, stale Apr 22, 2024
@crazytaxi824
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants