Speeding Up Terminal Load Time: How I Fixed a 90-Second Delay by Cleaning Up .zshrc File

24 April 2022
TL;DR

Every terminal tab took 90 seconds to open. Turns out .zshrc had the same if condition over 300 times, and keeping one fixed it.

This answer on Reddit helped troubleshoot. I just commented everything, and it made the load lightening fast. Then, on a closer look, I found this mess. No idea how it got to this, but commenting out all but one of them did the trick.

I was wondering why my terminal session was taking forever to load (~90 seconds each time I opened a tab). Then I found this in my .zshrc file. Over 300 lines of the same if condition. I have no idea how it got here, but removing all but one reduced the load time to 1 second — Amit Jotwani (@amit) April 24, 2022

View on X

The summary at the top was generated by AI.

Want to make something together, have an interesting problem, or just want to talk about one of these experiments?

hello@ajot.me