https://github.com/gary-ash/prompt
Snazzy Powerline style prompt for Bash and Zsh
https://github.com/gary-ash/prompt
bash shell-prompt zsh
Last synced: about 1 month ago
JSON representation
Snazzy Powerline style prompt for Bash and Zsh
- Host: GitHub
- URL: https://github.com/gary-ash/prompt
- Owner: Gary-Ash
- License: mit
- Created: 2025-03-19T01:53:53.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-04-23T19:18:59.000Z (5 months ago)
- Last Synced: 2025-04-23T20:28:09.705Z (5 months ago)
- Topics: bash, shell-prompt, zsh
- Language: C++
- Homepage:
- Size: 665 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- Contributing: .github/CONTRIBUTING.markdown
- Funding: .github/FUNDING.yml
- License: LICENSE.markdown
- Code of conduct: .github/CODE_OF_CONDUCT.markdown
Awesome Lists containing this project
README
## Snazzy Powerline Style Terminal Prompt

This repository contains my snazzy [Powerline](https://powerline.readthedocs.io/en/latest/index.html) style terminal prompt
**Options Environment Variables:**.
Prompt looks at two environment variables depending on whether or not it detects that the terminal supports true (24-bit) color or simply XTerminal 256 color
SNAZZY\_PROMPT=
SNAZZY\_PROMPT_TRUE=,Foreground color,Background color[,Alternate Foreground color,Alternate Background color]:
Color specifications are either an XTerminal 256 color table value or they follow a true color specification in the form of red <0 - 255>;green <0 - 255>;blue <0 - 255>
Segment Names:
* *cwd* Current working directory
* *err* Error status of the last command
* *git* git status if the current directory is a git working tree
* *machine* machine/host name
* *user* user name```zsh
#*****************************************************************************************
# prompt setup
#*****************************************************************************************
export SNAZZY_PROMPT="cwd,255,45,255,166:git,255,35,255,200:err,255,166"
export SNAZZY_PROMPT_TRUE="cwd,255;255;255,255;148;0,255;255;255,1:git,255;255;255,147;196;124,255;255;255,255;142;198:err,255;255;255,128;0;0"snazzy_prompt_precmd() {
PS1="$(/usr/local/bin/Prompt --error $?)"
}install_snazzy_prompt_precmd() {
for s in "${precmd_functions[@]}"; do
if [ "$s" = "snazzy_prompt_precmd" ]; then
return
fi
done
precmd_functions+=(snazzy_prompt_precmd)
}
install_snazzy_prompt_precmd
...
```# Building Prompt
cd scripts
./build-libgit2.sh
open the Xcode project file and build