A bare-bones Git prompt for zsh implemented in Rust for speed (and as a learning exercise).
Configuration is rudimentary because I figured “how often am I going to change the appearance of my Git prompt?”
cargo build --release
rm <bindir>/zsh-rust-git-prompt
— MANDATORY on Apple Silicon, optional on Intel. Simply copying or moving the new binary over the top of the old one will cause a code signature mismatch and lead to obscure zsh: killed
errors — see Updating Mac Software. Removing the old binary first flushes its code signature cache.cp target/release/zsh-rust-git-prompt <bindir>
where <bindir>
is in PATH
..zshrc
:RPROMPT='$(git status --porcelain=v2 --branch --show-stash -z 2>/dev/null | zsh-rust-git-prompt)'`(Or
PROMPT
if you prefer, but it’s really designed more for RPROMPT
.)cargo build --release
) and reinstall.main.rs
.main.rs
.*_style()
functions.