GUIDE 02 / TERMINAL STARTUP
Why does your Mac terminal start slowly?
For Macs using zsh. First establish whether the delay comes from shell startup, then review configuration and tool initialization.
1. Is the window slow, or is the shell slow?
If a terminal window appears quickly but its prompt takes a long time, shell initialization is worth investigating. If the whole terminal app opens slowly, or every command is slow, also inspect CPU use, memory pressure, storage, and the terminal app itself.
This guide uses zsh on macOS. First check the current process with the command below. The $SHELL variable identifies your default login shell, which is not necessarily the current process.
ps -p $$ -o comm=For bash, fish, remote SSH sessions, or containers, use the startup files and diagnostics appropriate to that environment.
2. Compare normal startup with most configuration skipped
Each command starts an interactive zsh and immediately exits. The first uses normal startup configuration; the second uses -f to skip most startup files. The system's /etc/zshenv may still run. This comparison measures shell initialization, not the complete time needed to create a terminal window.
/usr/bin/time -p /bin/zsh -i -c exit
/usr/bin/time -p /bin/zsh -f -i -c exitRepeat each a few times under similar system load and compare real. The first command runs your normal startup scripts, so use it only in a local environment where you trust those scripts. If normal startup is consistently much slower, inspect configuration and tool initialization next. If both are slow, investigate the system and environment as well.
Some terminals use a login shell. You can additionally compare /bin/zsh -l -i -c exit, which reads additional startup files. Warnings about job control when running outside a terminal do not necessarily indicate a startup fault.
3. Inspect one type of initialization at a time
Back up personal configuration before editing it. Interactive zsh normally reads .zshrc, while login shells also read files such as .zprofile. A configured ZDOTDIR changes where personal files live. Checking only one file does not rule out every startup cost.
- Repeated initialization: is the same version manager, completion system, or prompt loaded more than once?
- External commands on every startup: are network calls, package-manager queries, or expensive scans necessary for every new shell?
- Stale paths: does PATH repeatedly include missing or slow directories? Understand each entry before removing it.
- Recent changes: did the delay begin after installing a tool or plugin?
Temporarily disable one understood piece of personal configuration, repeat the same measurement, and restore unrelated changes. Do not delete the whole configuration or overwrite credentials, aliases, and work settings with someone else's minimal setup.
4. Inspect Memento's diagnostics and proposed effects
Memento's Terminal startup module inspects shell startup and PATH and provides ways to open related configuration. Where a repair is available, review its effect before confirming; configuration repairs create a backup first. Findings without an automatic repair still need investigation. A diagnostic list is not a promise of one-click fixes for every item.
With a model configured, you can ask AI about a specific finding. Avoid pasting entire configuration files containing keys or private data. A remote AI provider receives relevant context; read the privacy and safety explanation.
5. Verify under the same conditions
After one change, open the terminal the way you normally use it and repeat the measurement. Check that commands, version managers, prompts, and completion still work. If something breaks, restore the relevant configuration using your backup and maintenance record before adding more changes.
This page describes a comparison method, not invented before-and-after results. System load, configuration, tool versions, and login mode all affect the outcome.
References and related guides
For startup files and ZDOTDIR, see the official zsh startup/shutdown file documentation. Check Memento's current release notes for feature availability. If storage is also running low, continue with the Mac disk-space guide.