skip to Main Content

I recently enabled Windows Subsystem for Linux 2 (WSL2) on Windows 10 and installed Debian.

I also installed zsh with several plugins. You can see the dotfiles repo here: https://github.com/art3xias23/wsl-dotfiles

I’m using Windows Terminal, however there is no difference if I use gitbash and debian on their own or inside Windows Terminal.

My issue is:

I have a repo with 3 worktrees on my windows home directory.

When I use git bash for windows I can see the branch names fine after the directory.

GitBash

Repo1: enter image description here

Repo2: enter image description here

ZSHELL

Now when I move to zsh and try to access the same windows home directory worktrees, I can see the branch name for only the first repo and not the second or third (The first repo contains the .git directory)

I also don’t see any other branch names, like the one for the my wsl-dotfiles repo, which is my wsl home directory

====================================

enter image description here

====================================

Repo1: enter image description here

====================================

Repo2: enter image description here

====================================

Would anyone know why the branch names are not appearing.

2

Answers


  1. Chosen as BEST ANSWER

    Below I'll display my findings and close this question.

    1. Home directory branch not showing:

      Commenting out this line in my.p10k.zsh solved the issue

      typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~'

    2. Git worktree branch name not showing.

      Not yet supported as discussed here


  2. Seems like this is the default behavior of zsh. Follow instructions from git documentation to enable showing of git branch names:

    https://git-scm.com/book/uz/v2/Appendix-A%3A-Git-in-Other-Environments-Git-in-Zsh

    Zsh happens to be fairly compatible with Bash when it comes to prompt
    customization, but it allows you to have a right-side prompt as well.
    To include the branch name on the right side, add these lines to your
    ~/.zshrc file:

    setopt prompt_subst
    . ~/git-prompt.sh
    export RPROMPT=$'$(__git_ps1 "%s")'
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search