My minimalist shell setup — Bash in Terminal and Zsh in iTerm2
Update: March 2023. I move to https://alacritty.org as my primary terminal simulator.
The key is having 2 pairs of separate shell environments running independently — the fancy Zsh/iTerm2 setup as my primary shell environment, and Bash/Terminal as a stable fallback environment
The Terminal Application
Popular terminal applications on MacOS are:
- Terminal (MacOS built in)
- iTerm2 (most popular and my goto, written in Objective-C )
- Hyper (yet another popular one, an Electron-based terminal)
I personally prefer to download iTerm2 from their office website, unzip it and move the app file to the Application folder. For critical applications like iTerm2, I wanted to keep them without any extra dependencies like package manager or whatnot, so that I could have a stable and seamless user experience.
The Shell
Keep Bash as the default shell for Terminal
Keep the default setup as your plan B. If you happen to change it to one of the fancy shells (zsh, fish), I’d suggest switching back to bash to maximize the benefits of compatibility, stability, and availability.
Change it via the command line 👇
# use bash as default - recommended chsh -s /bin/bash# use zsh as default - still popular but I am not a fun of thischsh -s /bin/zsh
Or, change it via the UI 👇
System Preferences > Users & Groups >Unlock > Right click current user and choose “Advanced Options” > input Login shell > choose /bin/bash
Use Zsh in iTerm2 for fancy functionality
- Install Homebrew 👉 https://brew.sh/
- Install Zsh
brew install zsh
&zsh --version
- Install On My Zsh: https://ohmyz.sh/
- Use Zsh in iTerm2, Preferences > Profiles > General Tab > Command > Choose “Custom Shell” > input
/bin/zsh
The Theme
- Install my favourite Nerd Fonts — Hack
brew tap homebrew/cask-fontsbrew install --cask font-hack-nerd-font
2. Change the font in iTerm2
3. Change the Color Presets in iTerm2
The Plugins
- oh my zsh: https://github.com/ohmyzsh/ohmyzsh
- zsh auto suggestion: https://github.com/zsh-users/zsh-autosuggestions
- zsh auto highlight: https://github.com/zsh-users/zsh-syntax-highlighting
The Prompt
I have a customised prompt for zsh, check it out 👉 My minimalist prompt setup on zsh + oh-my-zsh
I also tried Starship for a couple of weeks, but I eventually stay with my minimalist prompt setup 👆
To Recap
- Have two separate shell environments — one for stability, one for usability
- Zsh in iTerm2 as the primary shell environment
- Bash in Terminal as the secondary shell environment