Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My Zsh is super slow inside a certain Git repo of mine. When I Google "zsh git slow", I get a bunch of results about Git autocompletion being slow, but autocompletion isn't necessarily my problem; it's everything.

I tried removing all plugins and that, strangely, didn't do anything at all when I opened a new shell. Zsh would still do Git stuff inside my Git repo.

I found this snippet on this page:

function git_prompt_info() {
  ref=$(git symbolic-ref HEAD 2> /dev/null) || return

That made everything fast again, but it also gave me a prompt that looks like this:

➜  snip git:(master

Note the missing right parenthesis. That's kind of lame. Plus the whole thing just seems like a hack I shouldn't have to do.

There's also this promising-looking SU question, but the links on the accepted answer are dead.

How can I get my Zsh not to be slow inside a Git repo?

share|improve this question
Can you link us to the SU question you mention? – slhck Sep 19 '12 at 15:42
Also, What did you have in your prompt when things were slow (before your snippet)? – studgeek Oct 9 '12 at 12:01

It's not that autocompletion is slow, it's that autocompletion makes every command seem slow because you are waiting for it to source stuff. Trying commenting out bash_completion completely in your zsh dot files.

share|improve this answer
There doesn't seem to be anything relevant there to comment out. – Jason Swett Oct 7 '12 at 0:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.