β Starship
β’ 332 words β’ 2 min
After years using the default prompt from
grml-zsh-config (with minor modifications), I adopted
starship:
The minimal, blazing-fast, and infinitely customizable prompt for any shell!
My ~/.config/starship.toml is meant to resemble the zsh prompt I’ve been using,
with minor tweaks and improvements:
toml
# Minimal starship config matching grml prompt
format = "$status$sudo$username$hostname$directory$git_branch$git_state$git_status$line_break$character"
right_format = "$cmd_duration$jobs"
add_newline = true
[status]
disabled = false
format = "[$status ]($style)"
style = "bold red"
[username]
show_always = true
format = "[$user](bold green)"
[hostname]
ssh_only = true
trim_at = "."
format = "@$hostname"
[directory]
truncation_length = 40
truncate_to_repo = true
format = " [$path](bold) "
[git_branch]
symbol = ""
format = "[$symbol$branch]() "
[git_state]
format = "|[$state]()"
[git_status]
format = "[$conflicted$deleted$renamed$modified$staged$untracked$ahead_behind](red) "
[cmd_duration]
min_time = 2000
format = "[$duration](yellow) "
[jobs]
format = "[$number](cyan) "
[sudo]
disabled = false
format = "[π](red) "
[character]
success_symbol = "[β―](green)"
error_symbol = "[β―](red)"My prompt:
thiago.perrotta .dotfiles master
β―Details you cannot easily tell from above:
- display the exit code if it is non-zero, and make the β― symbol red
- omit the hostname when not in SSH (no need to see
thiagoperrotta-MacBook-Proall the time) - display the command duration when a command took too long (>2s) to complete (right side)
- display the number of background jobs if any (right side)
- display a couple of git markers (e.g. pending pull, pending push, pending changes)
- display an icon when
sudo/doasis cached - separate prompts with a blank line (breathe!)
- colors!
- truncate the full directory path when inside a VCS repo
My .zshrc looks like this:
shell
# Use starship prompt if available, otherwise customize grml prompt.
if command -v starship &> /dev/null; then
prompt off
eval "$(starship init zsh)"
else
# Customize grml prompt: two lines, user in bold green
zstyle ':prompt:grml:left:items:user' pre '%B%F{green}'
zstyle ':prompt:grml:left:setup' items rc change-root user at host path vcs newline percent
fi…gracefully degrade when starship is not installed, using my original
grml-derived zsh prompt.
Side effect: now bash has a similar prompt to zsh!
Backlinks
- starship: github PR prompt (Jan 30, 2026)
- git: shell prompt: worktrees (Jan 10, 2026)