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.mdOptional: MacOS Terminal Theme
# Themes: https://github.com/lysyi3m/macos-terminal-themes
My fav: AlucardOptional: 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