Skip to content
C.W.K.
Stream
Lesson 06 of 10 · published

Prompt Customization

~10 min · prompt, starship, powerlevel10k

Level 0Window Tourist
0 XP0/95 lessons0/14 achievements
0/100 XP to next level100 XP to go0% complete

Why touch the prompt at all?

A good prompt tells you context — current directory, git branch, Python venv, last command status — without you having to ask. Three to five small facts keep your fingers from typing pwd, git status, and echo $? a hundred times a day.

Hand-rolled zsh prompt

setopt PROMPT_SUBST
autoload -U colors && colors
PROMPT='%F{cyan}%n%f@%m %~ %F{red}%(?..[%?] )%f%# '
RPROMPT='%F{8}%*%f'

Username (cyan), host, working dir, exit code only when non-zero (red), prompt char. Right side: clock.

Starship — the modern default

Cross-shell, fast (Rust), opinionated good defaults. Install:

brew install starship
echo 'eval "$(starship init zsh)"' >> ~/.zshrc

Starship auto-detects git status, language versions, k8s context, AWS profile, command duration. Customize via ~/.config/starship.toml; presets ship with one-line copy commands.

Powerlevel10k — zsh-only, blazing fast

P10k has the slickest first-time wizard (p10k configure) and an instant-prompt feature that shows the prompt before the rest of zsh finishes loading. zsh-only, but if you live in zsh, it's stunning.

Async / instant-prompt

Both Starship and P10k render the static parts immediately, then update git/Python info asynchronously. That's why a slick prompt can still feel instant — the slow bits aren't blocking your typing.

A prompt executes code after every command

Repeated Git and network queries can make the prompt itself the bottleneck in large repositories or slow mounts. Measure each display component and bound its work. Fast, correct state beats maximum information.

Do not encode critical state with color alone

Fonts, color vision, and remote terminal settings can break symbols. Show text labels and hostnames for production or remote context, then confirm with a dedicated command before acting.

Code

Switch to Starship in 60 seconds·bash
brew install starship
echo 'eval "$(starship init zsh)"' >> ~/.zshrc
exec zsh
# Try a preset
starship preset gruvbox-rainbow -o ~/.config/starship.toml

External links

Exercise

Install Starship: brew install starship. Add the eval line to .zshrc. exec zsh and cd into a git repo — see branch info appear. Then try a preset: starship preset nerd-font-symbols -o ~/.config/starship.toml.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.