ohmyzsh: Slow ohmyzsh start after PC restart due to Xcode git
Discussed in https://github.com/ohmyzsh/ohmyzsh/discussions/10690
<div type='discussions-op-text'>Originally posted by erychagov February 13, 2022 Hello. I notice that I have slow start of ohmyzsh. I found that the next line takes about 20 secs on my PC:
zcompdump_revision="#omz revision: $(builtin cd -q "$ZSH"; git rev-parse HEAD 2>/dev/null)"
I found this line in the $ZSH/oh-my-zsh.sh file.
Why we need it? I want to find a way to speedup it.
if you cd to $ZSH and then run
time git rev-parse HEADhow long does it take?
git rev-parse HEAD 0.01s user 0.00s system 76% cpu 0.014 total
that looks normal. how did you determine the offending line? I’m assuming by adding echo or printf statements until you zeroed in on it?
You’re right! I used echo to find the line.
Does this happen on each new terminal window?
Only first terminal window takes time
Do you see the same slow behavior when running
No.
</div>About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (9 by maintainers)
Oh you need to remove
2>/dev/nullsince dtruss writes to stderr.