|
|
|
|
|
by pyre
4782 days ago
|
|
local green="$(tput setaf 2)"
local reset="$(tput sgr0)"
export PS1="\[$green\]>>\[$reset\] "
Could be this in zsh: export PS1="%{%F{green}%}>>%{%f%} "
- %{%} replace \[\]
- %F{color} sets the foreground colour
- %f resets the foreground colourI would go with something like: export PS1="%{%(?.%F{green}.%F{red})%}>>%{%f%} "
It will be green if the last command exiting successfully, otherwise it will be red.There's also better history support (from my zsh config): # History
# ~~~~~~~
HISTSIZE=1000
SAVEHIST=1000
HISTFILE=$HOME/.zsh_history
setopt SHARE_HISTORY # Share history across sessions
setopt HIST_IGNORE_SPACE # commands starting w/ a space don't go into history
# SHARE_HISTORY seems to imply both of these, at least that's how the manpage
# reads, so let's comment them out for now.
#
# setopt INC_APPEND_HISTORY # Incrementally append history to file
# setopt EXTENDED_HISTORY # Save the timestamp and duration of commands to history file
|
|