Skip to content

Instantly share code, notes, and snippets.

@SebastianGrans
Created December 21, 2023 11:39
Show Gist options
  • Save SebastianGrans/b3addc947ebfdb1567231f69f3a6f637 to your computer and use it in GitHub Desktop.
Save SebastianGrans/b3addc947ebfdb1567231f69f3a6f637 to your computer and use it in GitHub Desktop.
WSL and `oh my zsh`

Is your zsh really slow when you go to a git repository in /mnt/c/ even though you don't have the git plugin enabled? It's probably because you use a oh my zsh theme that has the git info in it.

A popular theme is robbyrussel which has the git integration built in. In ~/.oh-my-zsh/themes/robbyrussell.zsh-theme you will find the following line:

PROMPT+=' $(git_prompt_info)'

If you don't care about git integration at all, you can simply comment out that line. If you still want to have the git status inside WSL you can run the following on any repos in /mnt/c/:

git config oh-my-zsh.hide-info 1

Here's a list of other oh-my-zsh themes that might be affected by that: ohmyzsh/ohmyzsh#3288 (comment)

The underlying problem

Accessing /mnt/c/ in WSL2 is very slow. Simply running git status in a git repo in /mnt/c/ will be terribly slow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment