A pragmatic bash
prompt done by a fish-shell
user!
- Lighweight and simple, no bloat
- Fast, optimized for low latencies
- Code validated using
bashate
andshellcheck
- Intended to be compatible and quite
POSIX
.
Supports prompting of:
- Username (in warning red if root)
- Timestamp of last command (see
DATE_FMT
) - Return value of last command
- State of version control (powered by
vcprompt
- seeVCPROMPT_FMT
) - Active Python
virtualenv
or current version managed bypyenv
- Use of a multiplexer (
screen
ortmux
).
Tested on iTerm2 nightlies:
brew cask install iterm2-nightly
$ brew install https://raw.githubusercontent.com/gretel/pragmaprompt/master/pragmaprompt.rb
Please follow the instructions shown:
The prompt needs to be enabled manually.
Please add the following to your .bashrc:
if [ -f "$(brew --prefix pragmaprompt)/share/pragmaprompt.sh" ]; then
source "$(brew --prefix pragmaprompt)/share/pragmaprompt.sh"
fi
Then, you may restart the shell:
exec bash
Clone this repository or get the file somehow and put it somehwere like ~/pragmaprompt.sh
.
Finally, include the file in your .bashrc
or .bash_profile
:
if [ -f "$HOME/pragmaprompt.sh" ]; then
source "$HOME/pragmaprompt.sh"
fi
While truly optional the following tool is supported:
vcprompt
- git, hg, and svn info at low latenciespyenv
- the currently activated virtualenv is shown - nice for Python hack*etc - otherwise maybe not.
On OS X homebrew can be used to get these:
brew install pyenv --HEAD
brew install tmux --HEAD
brew install vcprompt --HEAD
Using HEAD versions is optional but recommended especially in regards to
vcprompt
.
The bitbucket repo of
vcprompt
homebrew's HEAD formulae uses is one of the few actually being maintained.
A recommandable and well-matching font:
If you tend to use fish-shell
please check out the cyber-trance
theme for a similar approach.