10

I am having slow terminal startup times, in the 2 seconds range BUT only when opening a new Terminal window/tab (both iTerm2 and Terminal).

When launching zsh from an existing terminal window it launches quickly.

~ % /usr/bin/time zsh -i -c exit
        0.01 real         0.00 user         0.00 sys

~ % /usr/bin/time /bin/zsh -i -c exit
        0.01 real         0.00 user         0.00 sys

~ % /usr/bin/time /bin/bash -i -c exit
        0.00 real         0.00 user         0.00 sys

~ % /usr/bin/time bash -i -c exit
        0.01 real         0.00 user         0.00 sys

When opening a new window/tab, the tab title transitions between "login" "env" "bash" then finally "zsh".

Video LinkImgur

I have tried setting the default shell to /bin/zsh using chsh and also tried to set the shell in the terminal profile to /bin/zsh just in case.

There is nothing in my

.zshrc
/etc/zshrc

.bash_profile
.profile
.bashrc
/etc/bashrc

And when setting fish shell as the default shell, new terminal windows start instantaneously.

Do Terminal/iTerm have their own startup scripts?

Am I missing a config file that launches on start up of zsh on MacOS?

EDIT:

Ok when using the --login flag, it's observably slow

~ % /usr/bin/time zsh --login -i -c exit
        2.10 real         0.40 user         0.77 sys

EDIT2:

Changing the shell to Command makes it appear instantly. Where are the config steps for a zsh login shell?

enter image description here

1 Answer 1

19

Ok turns out homebrew added around 100 calls to set itself in my ~/.zprofile file

enter image description here

2
  • 8
    That's hilarious
    – Marco
    Commented Oct 24, 2022 at 9:46
  • Looks like some kind of non-idempotent configuration change that homebrew decided to do.
    – penguin359
    Commented Oct 25, 2022 at 9:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .