Skip to content
whoami

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

  1. 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 PATH so new shells can find it. The first line adds a setup line to ~/.zprofile only 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 --version
  2. Step 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 Ghostty

    Quit the built-in Terminal app and use Ghostty for every step after this one. Inside Ghostty windows, the ghostty command is on your PATH, and later steps use it to check your setup.

  3. 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 git

    Check that it worked:

    Terminal
    git --version
  4. Step 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-zsh before 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.

  5. 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-powerlevel10k

    This 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 Regular
  6. Step 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_THEME line in ~/.zshrc to 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=' ~/.zshrc
    Expected 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.

  7. 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/ghostty

    If 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, and config.ghostty wins 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
    EOF

    Now 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
    EOF

    Check the file for mistakes. No output means it is valid.

    Terminal
    ghostty +validate-config

    Press Cmd+Shift+, to reload the config. If the font does not change, open a new window with Cmd+N.

    To preview Ghostty's hundreds of built-in themes, run this command. Press F1 inside the preview for help, and Esc to close it.

    Terminal
    ghostty +list-themes
  8. Step 8: Configure Powerlevel10kAnswer a few questions and the wizard styles your prompt.

    Restart your shell so it loads Powerlevel10k.

    Terminal
    exec zsh

    The 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.zsh and adds a line to ~/.zshrc that loads that file.

    If the wizard does not start, or you want to change your answers later, run it yourself:

    Terminal
    p10k configure
  9. Step 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-highlighting

    Now turn them on. This backs up ~/.zshrc, replaces its plugins=(...) 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 zsh

    Here is what each plugin does:

    • git adds short aliases for common Git commands, and comes with Oh My Zsh.
    • zsh-autosuggestions shows a grey suggestion from your history as you type, and the right arrow key accepts it.
    • zsh-syntax-highlighting colors a command as you type it, so a misspelled command stands out before you run it.
    • web-search lets 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 terminal

    This guide restarts the shell with exec zsh instead of source ~/.zshrc, because the Powerlevel10k docs warn that sourcing ~/.zshrc again can cause odd problems.

  10. 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, type Open 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.

  11. 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 zoxide

    Next, add their settings to the end of ~/.zshrc, then restart the shell. The grep -q check 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 zsh

    What you get:

    • Ctrl+R searches your command history with fzf.
    • Ctrl+T finds a file and pastes its path into the command you are typing.
    • Option+C picks a folder and moves into it, which works because your Ghostty config makes Option act as Alt.
    • ls now shows icons and Git status for each file, thanks to eza.
    • z jumps 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 projects once, this jumps straight back to it from anywhere:

    Terminal
    z proj
  12. Step 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 $TERM
    Expected output
    xterm-ghostty

    Inside tmux, from the next guide, this prints tmux-256color instead, which is also correct.

    Next, confirm that the Ghostty config has no mistakes. No output means it is valid.

    Terminal
    ghostty +validate-config

    Finally, confirm that the theme and plugins lines in ~/.zshrc are set:

    Terminal
    grep -E '^(ZSH_THEME|plugins)=' ~/.zshrc
    Expected output
    ZSH_THEME="powerlevel10k/powerlevel10k"
    plugins=(git zsh-autosuggestions zsh-syntax-highlighting web-search)

sources