Best Zsh Theme to Display Full Path, Git Branch, Uncommitted Changes & Added Files: How to Edit Existing (Godzilla) or Find Recommendations
Your terminal prompt is more than just a cursor blinking at you—it’s a command center that can boost productivity by keeping critical information at your fingertips. If you’re a developer or power user, knowing your current directory’s full path, Git branch, and status of uncommitted changes/added files at a glance can save time and reduce errors.
By default, most Zsh themes lack this level of detail. Some show a truncated path, others omit Git status, and many are slow to render. In this guide, we’ll explore:
- Key features to prioritize in a Zsh theme for this use case.
- Top pre-built themes that excel at displaying these details.
- How to edit an existing theme (using the "Godzilla" theme as an example) to add missing features.
- Installation, configuration, and troubleshooting tips to ensure your prompt works flawlessly.
Table of Contents#
- Key Features to Look For in a Zsh Theme
- Top Zsh Themes for Full Path, Git Branch & Status
- Editing an Existing Theme: Customizing Godzilla
- How to Install & Configure Zsh Themes
- Troubleshooting Common Issues
- Conclusion
- References
Key Features to Look For in a Zsh Theme#
Before diving into themes, let’s define the "must-haves" for your ideal prompt:
1. Full Path Display#
- Why? A truncated path (e.g.,
.../project) forces you to runpwdto confirm your location, wasting time. A full path (e.g.,/home/user/dev/project/src) eliminates ambiguity. - How to spot it: Look for prompts using Zsh’s
%d(absolute path) or%~(relative to home, with~for$HOME).
2. Git Branch Visibility#
- Why? Switching between branches is common—knowing your current branch (e.g.,
main,feature/login) prevents accidental commits to the wrong branch. - How to spot it: Themes often display the branch name in the prompt (e.g.,
[main]or mainwith icons).
3. Uncommitted Changes Indicator#
- Why? Avoid "oops, I forgot to commit!" moments. A symbol (e.g.,
✗,!) should signal uncommitted modifications. - How to spot it: Look for prompts that run
git diff --quietunder the hood to detect unsaved changes.
4. Added (Staged) Files Indicator#
- Why? Track which changes are ready to commit. A symbol (e.g.,
+,✚) for staged files (viagit add) keeps you organized. - How to spot it: Themes use
git diff --cachedto check for staged changes and display an icon.
5. Performance#
- Why? A slow prompt (delays when navigating folders) kills productivity. Prioritize themes with async Git status checks (e.g., Powerlevel10k) to avoid lag.
6. Customizability#
- Why? You may want to tweak colors, icons, or truncate the path for long directories. Themes with easy configuration (e.g., JSON/YAML files, wizards) save time.
Top Zsh Themes for Full Path, Git Branch & Status#
If you’d rather use a pre-built theme than edit one, these options deliver all the features above:
Powerlevel10k: The Gold Standard#
Why it’s best: Powerlevel10k is fast, highly customizable, and designed to display everything you need. It’s the most popular Zsh theme for a reason.
Key Features:#
- Full Path: Configurable via the setup wizard (choose "Full path" or "Truncated path" during setup).
- Git Branch: Displays the branch name (e.g.,
main,dev) in bold. - Git Status: Shows icons for uncommitted changes (
✗), added files (+), untracked files (?), and more (e.g.,main +2 ✗3 ?1means 2 staged, 3 uncommitted, 1 untracked). - Performance: Uses async rendering to avoid lag, even in large repos.
- Icons: Supports Nerd Fonts for crisp symbols (e.g., 📁 for directories, for Git).
Example Prompt:#
/home/user/dev/project [main] +2 ✗3 ?1 ❯
Spaceship Prompt: Modular and Minimal#
Why it’s great: Spaceship is lightweight and modular—enable only the components you need (no bloat).
Key Features:#
- Full Path: Enable with
dirmodule (setdir:truncate:0in config to show full path). - Git Branch: Shown via the
git_branchmodule (e.g.,on main). - Git Status:
git_statusmodule displays↑(ahead),↓(behind),+(staged),!(uncommitted),?(untracked). - Customization: Configure via
spaceship.toml(e.g., change colors, icons, or order of modules).
Example Prompt:#
/home/user/dev/project on main [+!] ❯
Agnoster: Classic but Configurable#
Why it’s popular: Agnoster is a long-standing favorite, known for its clean, segmented design.
Key Features:#
- Full Path: Disabled by default (shows truncated path), but editable (see customization tips).
- Git Branch: Prominently displays the branch (e.g.,
mainin a green segment). - Git Status: Shows
✗for uncommitted changes and+for staged files. - Cons: Slower than Powerlevel10k in large repos (no async rendering).
Example Prompt (After Enabling Full Path):#
user@machine /home/user/dev/project main +✗ $
Bullet Train: Info-Dense#
Why it works: Bullet Train packs a ton of info into a compact prompt, ideal for developers who want "at-a-glance" data.
Key Features:#
- Full Path: Enabled by default (uses
%~for relative path with~). - Git Branch: Shows branch name and status (e.g.,
main ⇡2 ⇣1 ✗for ahead, behind, and uncommitted changes). - Icons: Uses simple symbols (no Nerd Fonts required, though supported).
Example Prompt:#
user@machine ~/dev/project (main ⇡2 ⇣1 ✗) $
Editing an Existing Theme: Customizing Godzilla#
If you love the Godzilla theme but it’s missing full path, Git branch, or status, you can edit it directly. Here’s how:
Step 1: Locate the Godzilla Theme File#
Godzilla is likely installed via Oh My Zsh (the most popular Zsh framework). Find its file at:
~/.oh-my-zsh/themes/godzilla.zsh-theme If you can’t find it, search your system:
find ~ -name "godzilla.zsh-theme" Step 2: Display the Full Path#
Godzilla may truncate the path by default. To show the full path, modify the PROMPT variable in the theme file.
Zsh Prompt Escapes for Paths:#
%d: Absolute path (e.g.,/home/user/dev/project).%~: Relative path (e.g.,~/dev/projectif in$HOME).
Example Edit:#
Look for a line like:
PROMPT='%n@%m:%1~$ ' # Truncated path (%1~ shows only the last directory) Replace %1~ with %d (full absolute path) or %~ (relative full path):
PROMPT='%n@%m:%d$ ' # Now shows full path: user@machine:/home/user/dev/project$ Step 3: Add Git Branch Display#
To show the current Git branch, add a function to fetch the branch name and inject it into the prompt.
Step 3.1: Add a Git Branch Function#
At the top of godzilla.zsh-theme, add:
# Get current Git branch (or empty if not in a repo)
git_branch() {
git rev-parse --abbrev-ref HEAD 2>/dev/null || return
} Step 3.2: Update the Prompt to Include the Branch#
Modify the PROMPT to include $(git_branch) (or wrap it in color codes for visibility). For example:
# Add [branch] in green to the prompt
PROMPT='%n@%m:%d %F{green}[%f$(git_branch)%F{green}]%f$ ' Now your prompt will look like:
user@machine:/home/user/dev/project [main]$
Step 4: Show Uncommitted Changes & Added Files#
To display uncommitted changes (✗) and added files (+), add two more functions to check Git status.
Step 4.1: Add Git Status Functions#
Add these to godzilla.zsh-theme:
# Check for uncommitted changes (✗ if dirty)
git_uncommitted() {
if ! git diff --quiet --exit-code; then
echo "✗"
fi
}
# Check for staged (added) files (+ if any)
git_staged() {
if ! git diff --cached --quiet --exit-code; then
echo "+"
fi
} Step 4.2: Update the Prompt with Status Icons#
Modify the PROMPT to include $(git_staged) and $(git_uncommitted):
PROMPT='%n@%m:%d %F{green}[%f$(git_branch)%F{yellow}$(git_staged)$(git_uncommitted)%f%F{green}]%f$ ' Now your prompt will show:
[main](clean repo).[main+](staged files).[main✗](uncommitted changes).[main+✗](both staged and uncommitted changes).
Step 5: Test and Reload the Theme#
Save the godzilla.zsh-theme file, then reload Zsh to apply changes:
source ~/.zshrc If the prompt doesn’t update, run omz reload (if using Oh My Zsh) or restart your terminal.
How to Install & Configure Zsh Themes#
For Oh My Zsh Users (Most Common):#
-
Install the Theme:
- For built-in themes (e.g., Agnoster), no installation needed—just enable it.
- For external themes (e.g., Powerlevel10k):
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
-
Enable the Theme:
Edit~/.zshrcand set:ZSH_THEME="powerlevel10k/powerlevel10k" # or "spaceship", "agnoster", etc. -
Configure:
- Powerlevel10k: Run
p10k configureto launch the setup wizard (choose full path, Git status, icons, etc.). - Spaceship: Create
~/.spaceshiprc.zshorspaceship.tomlto enable modules (see docs).
- Powerlevel10k: Run
For Manual Installation (No Oh My Zsh):#
- Clone the theme repo (e.g., Spaceship):
git clone https://github.com/spaceship-prompt/spaceship-prompt.git "$HOME/.spaceship" --depth=1 - Source the theme in
~/.zshrc:source "$HOME/.spaceship/spaceship.zsh"
Troubleshooting Common Issues#
Icons Not Displaying?#
- Fix: Install a Nerd Font (e.g., FiraCode Nerd Font) and set it as your terminal’s font. Most themes use Nerd Font icons.
Full Path Too Long?#
- Fix: Truncate the path by limiting depth. For example, in Powerlevel10k, run
p10k configureand choose "Truncate to 2 directories" under "Directory truncation".
Git Info Missing?#
- Fix:
- Ensure Git is installed (
git --version). - For Oh My Zsh, enable the Git plugin: Add
plugins=(git)to~/.zshrc.
- Ensure Git is installed (
Slow Prompt?#
- Fix: Use themes with async Git status (e.g., Powerlevel10k). For custom themes, avoid running
gitcommands directly in the prompt—useasynclibraries or cache results.
Conclusion#
The best Zsh theme for full path, Git branch, and status depends on your needs:
- Powerlevel10k is unbeatable for speed, customization, and out-of-the-box features.
- Spaceship is ideal if you want a minimal, modular setup.
- Custom Godzilla works if you prefer tweaking an existing theme to your taste.
With the right theme, you’ll spend less time checking pwd or git status and more time coding.