一个简单的 {bash, zsh} 提示符,适用于程序员
a simple {bash, zsh} prompt for programmers
$ curl https://sh.rustup.rs -sSf | sh
Rust is installed now. Great!
# check if you have the latest version.
# pista works with rustc >= 1.34
$ rustc --version
rustc 1.36.0 (a53f9df32 2019-07-03)
# update rust if required
$ rustup updatepista with cargo (rust's package manager):# if you want to install from source, skip over to 1b
$ cargo install pista
$ ~/.cargo/bin/pista -V
Pista 0.1.2
# yay!# install from source
$ git clone https://github.com/nerdypepper/pista --recurse-submodules
$ cargo install --path ./pista --force
$ ~/.cargo/bin/pista -V
Pista 0.1.2
# yay!PS1:PS1='$(pista)' # regular variant
PS1='$(pista -m)' # minimal variant.zshrc:autoload -Uz add-zsh-hook
_pista_prompt() {
PROMPT="$(pista -z)" # `pista -zm` for the miminal variant
}
add-zsh-hook precmd _pista_promptpista handles prompt modifications when you enter virtual environments.
make sure to disable virtualenv's changes.
export VIRTUAL_ENV_DISABLE_PROMPT=1thats it! read on if you aren't happy with the defaults.
this is the default configuration. drop this in your .bashrc (or .zshrc) to get started.
remember to source ~/.bashrc (or source ~/.zshrc) to observe the changes!
…all 16 colors are available:
black
red
green
yellow
blue
magenta (or purple)
cyan
white
bright black
bright red
bright green
bright yellow
bright blue
bright magenta (or purple)
bright cyan
bright white暂无开放 Issues,或尚未同步最近议题。