Set up a Mac terminal with Ghostty
Ghostty, Oh My Zsh, Powerlevel10k, a Nerd Font, and the coolnight colors, with every command ready to paste.
- Platform
- macOS on Apple silicon
- Time
- About 20 minutes
- Steps
- 12
This guide follows Josean Martinez's popular terminal setup, with one change: it uses Ghostty instead of iTerm2. Ghostty is a fast, native macOS terminal that is configured with a plain text file, so every iTerm2 menu step becomes a few lines of config. Paste each block into your terminal one at a time, and wait for it to finish before moving on.
Verified with Ghostty 1.3.1 · macOS 27.0
steps
Step 1: Install HomebrewThe package manager that installs everything else in this guide.
Open the built-in Terminal app for now, then run the Homebrew installer. It asks for your Mac password and may install the Xcode Command Line Tools first.
Terminal /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Add Homebrew to your
PATHso new shells can find it. The first line adds a setup line to~/.zprofileonly if it is not there yet, so running it twice is safe. The second line loads Homebrew into the window you have open now.Terminal grep -q 'brew shellenv' ~/.zprofile 2>/dev/null || echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)"Check that it worked:
Terminal brew --versionStep 2: Install GhosttyThe terminal app you will use for the rest of this guide, in place of iTerm2.
Install Ghostty with Homebrew, then open it.
Terminal brew install --cask ghostty open -a GhosttyQuit the built-in Terminal app and use Ghostty for every step after this one. Inside Ghostty windows, the
ghosttycommand is on yourPATH, and later steps use it to check your setup.Step 3: Install GitVersion control, which the next steps use to download a theme and plugins.
Install the latest Git from Homebrew.
Terminal brew install gitCheck that it worked:
Terminal git --versionStep 4: Install Oh My ZshA framework that manages your zsh settings, themes and plugins.
Oh My Zsh takes over your shell settings file,
~/.zshrc. If you already have one, the installer saves it as~/.zshrc.pre-oh-my-zshbefore writing a new one.Terminal sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"When it finishes, it starts a fresh zsh with a new prompt.
Step 5: Install the MesloLGS NF fontThe font Powerlevel10k expects, with the icons it draws in your prompt.
Powerlevel10k draws small icons in your prompt, and those icons need a special font called MesloLGS NF. In iTerm2 its setup wizard can install the font for you, but not in Ghostty, so install it with Homebrew instead.
Terminal brew install --cask font-meslo-for-powerlevel10kThis installs four font files: Regular, Bold, Italic and Bold Italic. Check that Ghostty can see them:
Terminal ghostty +list-fonts | grep "MesloLGS NF"Expected output MesloLGS NF MesloLGS NF Bold MesloLGS NF Bold Italic MesloLGS NF Italic MesloLGS NF RegularStep 6: Install Powerlevel10kA fast prompt theme that shows your folder, Git branch and more at a glance.
Download the theme into Oh My Zsh's folder for custom themes.
Terminal git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k"Next, switch the
ZSH_THEMEline in~/.zshrcto Powerlevel10k. The first line saves a dated backup, such as~/.zshrc.bak-20260927-101500, so you can undo the change. The last line prints the result.Terminal cp ~/.zshrc ~/.zshrc.bak-$(date +%Y%m%d-%H%M%S) sed -i '' 's|^ZSH_THEME=.*|ZSH_THEME="powerlevel10k/powerlevel10k"|' ~/.zshrc grep '^ZSH_THEME=' ~/.zshrcExpected output ZSH_THEME="powerlevel10k/powerlevel10k"Do not restart your shell yet. The next step sets Ghostty's font first, so the Powerlevel10k setup wizard can draw its icons.
Step 7: Set Ghostty's font, size and colorsA few lines of config replace iTerm2's Profiles > Text and Profiles > Colors screens.
Ghostty reads its settings from a plain text file,
~/.config/ghostty/config.ghostty. First, see what is already in that folder:Terminal ls ~/.config/ghosttyIf the folder does not exist yet, that is fine, because the commands below create it. If you see an older file named just
config, Ghostty still reads it, andconfig.ghosttywins wherever both set the same option.Save the coolnight colors as a Ghostty theme. The colors come from Josean's own Ghostty config. The first two lines create the themes folder and back up any theme file with the same name.
Terminal mkdir -p ~/.config/ghostty/themes [ -f ~/.config/ghostty/themes/coolnight ] && cp ~/.config/ghostty/themes/coolnight ~/.config/ghostty/themes/coolnight.bak-$(date +%Y%m%d-%H%M%S) cat > ~/.config/ghostty/themes/coolnight <<'EOF' background = #00111E foreground = #CBE0F0 cursor-color = #47FF9C cursor-text = #011423 selection-background = #033259 selection-foreground = #CBE0F0 palette = 0=#214969 palette = 1=#E52E2E palette = 2=#44FFB1 palette = 3=#FFE073 palette = 4=#0FC5ED palette = 5=#a277ff palette = 6=#24EAF7 palette = 7=#24EAF7 palette = 8=#214969 palette = 9=#E52E2E palette = 10=#44FFB1 palette = 11=#FFE073 palette = 12=#A277FF palette = 13=#a277ff palette = 14=#24EAF7 palette = 15=#24EAF7 EOFNow write the main config file, after backing up the one you already have, if any. It sets the font, a font size of 20 as in Josean's iTerm2 setup, the coolnight theme, and some padding. The last setting makes the Option key act as Alt, which Claude Code's Option shortcuts need.
Terminal [ -f ~/.config/ghostty/config.ghostty ] && cp ~/.config/ghostty/config.ghostty ~/.config/ghostty/config.ghostty.bak-$(date +%Y%m%d-%H%M%S) cat > ~/.config/ghostty/config.ghostty <<'EOF' # Font (iTerm2: Profiles > Text) font-family = "MesloLGS NF" font-size = 20 # Colors (iTerm2: Profiles > Colors > coolnight) theme = coolnight # Space between the text and the window edge window-padding-x = 10 window-padding-y = 10 # Option works as Alt, which Claude Code shortcuts use macos-option-as-alt = true EOFCheck the file for mistakes. No output means it is valid.
Terminal ghostty +validate-configPress
Cmd+Shift+,to reload the config. If the font does not change, open a new window withCmd+N.To preview Ghostty's hundreds of built-in themes, run this command. Press
F1inside the preview for help, andEscto close it.Terminal ghostty +list-themesStep 8: Configure Powerlevel10kAnswer a few questions and the wizard styles your prompt.
Restart your shell so it loads Powerlevel10k.
Terminal exec zshThe setup wizard starts on its own. It first asks whether some icons look right, which they should now that Ghostty uses MesloLGS NF. Then pick the prompt style you like. The wizard saves your answers in
~/.p10k.zshand adds a line to~/.zshrcthat loads that file.If the wizard does not start, or you want to change your answers later, run it yourself:
Terminal p10k configureStep 9: Install the zsh pluginsSuggestions from your history as you type, and colors that flag typos before you press Enter.
Download two popular plugins into Oh My Zsh's folder for custom plugins.
Terminal git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlightingNow turn them on. This backs up
~/.zshrc, replaces itsplugins=(...)line, and restarts the shell.Terminal cp ~/.zshrc ~/.zshrc.bak-$(date +%Y%m%d-%H%M%S) sed -i '' 's|^plugins=(.*)|plugins=(git zsh-autosuggestions zsh-syntax-highlighting web-search)|' ~/.zshrc exec zshHere is what each plugin does:
gitadds short aliases for common Git commands, and comes with Oh My Zsh.zsh-autosuggestionsshows a grey suggestion from your history as you type, and the right arrow key accepts it.zsh-syntax-highlightingcolors a command as you type it, so a misspelled command stands out before you run it.web-searchlets you search the web from the terminal, and also comes with Oh My Zsh.
Try the last one, which opens a Google search in your browser:
Terminal google ghostty terminalThis guide restarts the shell with
exec zshinstead ofsource ~/.zshrc, because the Powerlevel10k docs warn that sourcing~/.zshrcagain can cause odd problems.Step 10: Use the font in VS Code's terminaloptionalMakes the prompt icons show up in VS Code's built-in terminal too.
Skip this step if you do not use VS Code.
In VS Code, press
Cmd+Shift+P, typeOpen User Settings (JSON), and press Enter. Add the font setting inside the outer curly braces. If the file already has other settings, add only the middle line, and put a comma at the end of the line before it.settings.json (VS Code) { "terminal.integrated.fontFamily": "MesloLGS NF" }Save the file, then choose Terminal > New Terminal from VS Code's menu bar.
Step 11: Add fzf, fd, eza and zoxideoptionalFuzzy search, a faster find, a nicer ls, and a cd that learns your favorite folders.
These four tools come from Josean's follow-up post on command line tools. Install them with Homebrew:
Terminal brew install fzf fd eza zoxideNext, add their settings to the end of
~/.zshrc, then restart the shell. Thegrep -qcheck skips the append if the block is already there, so running this twice is safe.Terminal grep -q '# ---- FZF -----' ~/.zshrc || cat >> ~/.zshrc <<'EOF' # ---- FZF ----- eval "$(fzf --zsh)" export FZF_DEFAULT_COMMAND="fd --hidden --strip-cwd-prefix --exclude .git" export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" export FZF_ALT_C_COMMAND="fd --type=d --hidden --strip-cwd-prefix --exclude .git" # ---- Eza (better ls) ----- alias ls="eza --color=always --long --git --no-filesize --icons=always --no-time --no-user --no-permissions" # ---- Zoxide (better cd) ---- eval "$(zoxide init zsh)" EOF exec zshWhat you get:
Ctrl+Rsearches your command history with fzf.Ctrl+Tfinds a file and pastes its path into the command you are typing.Option+Cpicks a folder and moves into it, which works because your Ghostty config makes Option act as Alt.lsnow shows icons and Git status for each file, thanks to eza.zjumps to a folder you visited before when you type part of its name, thanks to zoxide.
For example, after you have visited a folder called
projectsonce, this jumps straight back to it from anywhere:Terminal z projStep 12: Check your setupThree quick checks that confirm everything is wired up.
Run each check in a Ghostty window. First, confirm that you are really in Ghostty:
Terminal echo $TERMExpected output xterm-ghosttyInside tmux, from the next guide, this prints
tmux-256colorinstead, which is also correct.Next, confirm that the Ghostty config has no mistakes. No output means it is valid.
Terminal ghostty +validate-configFinally, confirm that the theme and plugins lines in
~/.zshrcare set:Terminal grep -E '^(ZSH_THEME|plugins)=' ~/.zshrcExpected output ZSH_THEME="powerlevel10k/powerlevel10k" plugins=(git zsh-autosuggestions zsh-syntax-highlighting web-search)
sources
- Josean Martinez: How to set up your Mac terminal
- Josean Martinez: Ghostty config (coolnight colors)
- Ghostty documentation
- Homebrew
- Ghostty: Install
- Git
- Oh My Zsh
- Powerlevel10k: Meslo Nerd Font
- Powerlevel10k: Oh My Zsh install
- Ghostty: Configuration
- Ghostty: Color themes
- Claude Code: Option key shortcuts on macOS
- Powerlevel10k: Configuration wizard
- zsh-autosuggestions
- zsh-syntax-highlighting
- Josean Martinez: 7 amazing CLI tools