Skip to content
Tech News
← Back to articles

Life is too short for a slow terminal

read original get USB-C Portable SSD → more articles

Update: a reader sent some great pushback on how I measured "fast" here, and on a couple of my recommendations. I wrote a follow-up on benchmarking shells properly and where this post falls short.

Practically all of my work happens inside a terminal. Git, kubectl, tmux, ssh'ing into a server, open practically the entire day. Something I use that much has to be fast. Any lag in opening a new tab, typing a character or hitting tab for a completion is something I feel hundreds of times a day. It's death by a thousand cuts.

My shell starts in about 30 milliseconds:

$ for i in { 1 .. 5 } ; do /usr/bin/time zsh -i -c exit ; done 0.03 real 0.02 user 0.01 sys 0.03 real 0.02 user 0.01 sys .. .

That's a fully loaded interactive shell with completions, syntax highlighting, autosuggestions, fzf and direnv, in less time than a single frame at 30fps. A new tab is instant. There was never some big optimization project behind this either; I've just always kept my shell minimal and fast and over the years that turned into a habit. Here's how I go about it, and all of it can be found in my dotfiles.

No framework

The single biggest win is what's not there: no oh-my-zsh, no prezto or plugin manager. I've honestly never understood the appeal of these frameworks. People install oh-my-zsh with its hundreds of plugins and themes, end up using maybe 5% of what it offers, and then pay (with their time and compute resources) for the other 95% every single time they open a shell. And plugin managers add their own overhead on top of that.

I use exactly three plugins, git-cloned once by my install script and sourced from .zshrc :

source ~/.zsh/fzf-tab/fzf-tab.plugin.zsh source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

There's no plugin manager doing dependency resolution at startup, and a source of a file that's already on disk is practically free.

... continue reading