Default terminal command prompts across Linux distributions—such as the standard Bash user@hostname:~$—provide minimal context regarding your active development environment. Manually checking Git branch status, untracked changes, programming runtime versions (Node.js, Python, Rust, Go), or AWS authentication profiles requires running multiple diagnostic commands repeatedly. Starship is a blazingly fast, heavily customisable, cross-shell prompt written in Rust that displays contextual workflow metadata concisely while adding zero perceptible latency to your terminal.
Installing Starship Across Linux Distributions
Starship is distributed as a single lightweight binary with zero external dependencies. You can install it through native package managers or via the official POSIX installation script.
On Arch Linux and Manjaro:
sudo pacman -S starship
On Fedora and RHEL-derived distributions:
sudo dnf install starship
On Debian, Ubuntu, or any distribution lacking a native package entry, run the automated installation script to place the binary inside /usr/local/bin:
curl -sS https://starship.rs/install.sh | sh
Confirm the installation and verify the version:
starship --version
Installing a Nerd Font for Symbol Rendering
Starship relies on glyph icons (such as Git branch forks, language logos, and package boxes) provided by Nerd Fonts. To ensure symbols render correctly rather than displaying missing character boxes:
- Download a modern Nerd Font (such as FiraCode Nerd Font, JetBrainsMono Nerd Font, or Hack Nerd Font) from the official Nerd Fonts repository.
- On Linux, place the unpacked
.ttfor.otffont files inside your user fonts folder:
mkdir -p ~/.local/share/fonts
cp ~/Downloads/*.ttf ~/.local/share/fonts/
fc-cache -fv
In your terminal emulator preferences (GNOME Terminal, Alacritty, Kitty, or WezTerm), set your font family to the installed Nerd Font variant.
Initialising Starship in Your Shell Configuration
Starship operates seamlessly across all major Unix shells. Append the initialisation hook to your respective shell profile:
For Bash (edit ~/.bashrc):
eval "$(starship init bash)"
For Zsh (edit ~/.zshrc):
eval "$(starship init zsh)"
For Fish (edit ~/.config/fish/config.fish):
starship init fish | source
Reload your configuration or spawn a new terminal window to activate the prompt immediately:
source ~/.bashrc
Configuring Starship with starship.toml
All Starship customisation takes place within a single declarative configuration file located at ~/.config/starship.toml. If this file does not exist, create it:
mkdir -p ~/.config
touch ~/.config/starship.toml
Open the file in your preferred text editor and establish your layout rules:
# Insert a blank line between shell commands
add_newline = true
# Define the global prompt character
[character]
success_symbol = "[➜](bold green)"
error_symbol = "[✗](bold red)"
# Customise directory formatting
[directory]
truncation_length = 3
truncation_symbol = "…/"
style = "bold cyan"
# Configure Git branch status
[git_branch]
symbol = "🌱 "
style = "bold purple"
# Configure Git status indicators
[git_status]
style = "bold red"
ahead = "⇡${count}"
diverged = "⇕⇡${ahead_count}⇣${behind_count}"
behind = "⇣${count}"
modified = "!"
staged = "+"
untracked = "?"
# Display command duration for commands taking longer than 2 seconds
[cmd_duration]
min_time = 2000
style = "bold yellow"
format = "took [$duration]($style) "
Applying Pre-Built Community Presets
If you prefer ready-made aesthetics—such as a minimal plain text layout, bracketed segments, or powerline arrow separators—Starship includes built-in presets that you can generate directly into your configuration:
# View available presets
starship preset --help
# Apply the Nerd Font Symbols preset
starship preset nerd-font-symbols -o ~/.config/starship.toml
# Apply the Pastel Powerline preset
starship preset pastel-powerline -o ~/.config/starship.toml
Modifications saved to ~/.config/starship.toml take effect instantaneously in your terminal upon pressing Enter, without requiring a shell restart.