Skip to content

Instantly share code, notes, and snippets.

@iamjohnmills
Last active June 7, 2026 02:07
Show Gist options
  • Select an option

  • Save iamjohnmills/903c23c09deb77d9866fb6f9a65dd33d to your computer and use it in GitHub Desktop.

Select an option

Save iamjohnmills/903c23c09deb77d9866fb6f9a65dd33d to your computer and use it in GitHub Desktop.
Customzing your Macos terminal with ZSH and Themes

Gist Overview: Make a sleek custom ZSH prompt and theme for ZSH on MacOS (2025)


Customize ZSH Profile Prompt

# Open ZSHRC profile file
nano ~/.zshrc

# Function to adjust prompt to display current git branch with current directory
function branch_name() {
    git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/\1 /p'
}
setopt PROMPT_SUBST
export PROMPT='%b%F{blue}$(branch_name)%b%f%B%F{white}%1d%f%b %B%F{red}#%b%f '

# Reload ZSH
source ~/.zshrc

# Optional: zsh-autosuggestions
https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md

Optional: MacOS Terminal Theme

# Themes: https://github.com/lysyi3m/macos-terminal-themes
My fav: Alucard

Optional: Install ZSH Within Docker Container (Linux)

# First exec into the container
docker exec -it <my-container-name> /bin/sh

# Install ZSH and Nano
apt-get update && apt-get install -y zsh
touch ~/.zshrc
echo "export PROMPT='%b%F{white}@docker%f%b %B%F{white}%1d%f%b %B%F{cyan}#%b%f '" >> ~/.zshrc

# Start zsh
zsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment