Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: ZSH vcs_info are not updated if alias is used

The problem is here: https://github.com/lony/dotFiles/blob/f5f1691499e7a95a3a2e4f1e0970f0ae46f4b40e/ansible/roles/dotfiles/src/bash_zsh/.zsh_oh-my-zsh/themes/lony.zsh-theme#L69.

This code tries to avoid calling `vcs_info` unless the last command in the history was a `git` command. This is liable to break in corner cases. E.g., if you change the state of a git repo in one shell, it won't be updated in another.


On Tue, Apr 23, 2019 at 10:54 AM Goetz Epperlein <lony_@xxxxxx> wrote:
Hello ZSH maintainers,

I have a bug regarding the vcs_info extension.

When I change my branch inside my zsh sadly it is not reflecting the current branch if I use an alias, but works if I use git checkout <branch>  I traced the problem down to vcs_info as my theme is using it to render the branch name, but do not know how to solve this.


I use oh-my-zsh and my custom theme for oh-my-zsh hosted on github.

My current zsh version is:

    ❯ zsh --version
    zsh 5.7.1 (x86_64-apple-darwin18.2.0)

My aliases look like the following:

    ❯ alias | grep gc
    gc='git checkout'
    gco='git commit'

My git version is:

    ❯ git --version
    git version 2.21.0

I run zsh inside tmux on a Mac using iTerm2, as everything is installed with homebrew it is updated to the latest version.

Any ideas what could cause this and how to fix it?

I also posted this question on stackoverflow, if this is easier to answer somehow: 

This bug maybe related to users/20807

Any help would be appreciated.

Thank you and kind regards,

Messages sorted by: Reverse Date, Date, Thread, Author