"Untitled Post" - Views: 2,425 · Hits: 2,425 - Type: Unlisted

function precmd {
  exit_status=$?
  prompt="┌"
  col=""

  if [ $exit_status = 0 ]; then
    prompt+="─╼"
    b_prompt="└────╼"
    col="green"

  else
    prompt+="─╼"
    b_prompt="└╼"
    col="red"
  fi

  PROMPT="%B%F{blue}$prompt%f %F{white}%b[%~]%f
%B%F{blue}$b_prompt%f%b "

RPROMPT="%B%F{$col}%t%f%b"
}