Powerline for Bash in pure Bash script.
- Git branch: show current git branch name, or short SHA1 hash when the head is detached.
- Git branch: show "+" symbol when current branch is changed but uncommited.
- Git branch: show "⇡" symbol and number of commits current branch is ahead of remote.
- Git branch: show "⇣" symbol and number of commits current branch is behind of remote.
- Platform-dependent prompt symbol for MacOS and Linux.
- Color-coded prompt symbol according to previous command execution status.
- Use Bash builtin when possible to reduce delay. Delay sucks!
- No need for patched fonts.
Download the Bash script
curl https://raw.githubusercontent.com/riobard/bash-powerline/master/bash-powerline.sh > ~/.bash-powerline.sh
And source it in your .bashrc
source ~/.bash-powerline.sh
For best result, use Solarized colorscheme for your terminal emulator. Or hack your own colorscheme by modifying the script. It's really easy.
This script is inspired by powerline-shell, which is implemented in Python. Python scripts are much easier to write and maintain than Bash scripts, but invoking Python interpreter introduces noticable delay to draw. I hate delays, so I ported just the part I need to pure Bash script.
The other reason is that I don't like the idea of patching fonts. The font patching mechanism from the original Powerline does not work with the bitmap font (Apple Monaco without anti-aliasing) I use on non-retina screens. I'd rather stick with existing unicode symbols.
- powerline: Unified Powerline written in Python. This is the future of all Powerline derivatives.
- vim-powerline: Powerline in Vim writtien in pure Vimscript. Deprecated.
- tmux-powerline: Powerline for Tmux written in Bash script. Deprecated.
- powerline-shell: Powerline for Bash/Zsh/Fish implemented in Python. Might be merged into the unified Powerline.
- emacs powerline: Powerline for Emacs