precmd() {
	
}
function prompt_ee_precmd {
	local exitstatus=$?
	psvar=(SIG)
	[[ $exitstatus -gt 128 ]] && psvar[1]=SIG$signals[$exitstatus-127]
	[[ $psvar[1] = SIG ]] && psvar[1]=$exitstatus
	jobs % >/dev/null 2>&1 && psvar[2]=
}

#
# Ideally, my prompt would vary per machine, always stand properly out,
# and actively display information when I need it.
#

function prompt_ee_setup {
  local delimiter=" "
  local has_userhost
  #PS1="%B%n(%m)%~%#%b "
  #PS1='%B[%(2L.%L/.)]%B%(?..%B{%v}%b)%n%(2v.%B@%b.@)%m:%B%~%b%(!.#.>) '
  #PS1='%B(?..%B{%v}%b)%n%(2v.%B@%b.@)%m:%B%~%b%(!.#.>) '
  #PS1='[%(2L.%L/.)]%(?..%B{%v}%b)%n%(2v.%B@%b.@)%m:%B%~%b%(!.#.>) '
  # Normal, very low-key prompt
  #PS1='%(2L.[%L].)%(?..%B{%v}%b)%n%(2v.%B@%b.@)%m:%B%~%b%# '
  # Bold prompt, with non-bold as information about jobs etc
  #PS1='%B%(2L.[%L].)%(?..%b{%v}%B)%n%(2v.%b@%B.@)%m:%~%#%b '
  #PS2='%(4_:... :)%3_> '
  PS1S=""
  PS1E=""
  # Include shell level as [<shell level>] at the start of the prompt if we
  # are higher than level 1 (ie, we are running a recursive shell, e.g. an su)
  PS1S="${PS1S}%(2L.[%L].)"
  # Here goes  for signal/exit code
  PS1S="${PS1S}%(?..%B{%v}%b)"
  # XXX The following gives a bold/non-bold depending on whether we have jobs
  # %(2v.%B@%b.@)
  if [ $(id -u) = "0" ]; then
	# Always include username if we are root, and make it bold if we have
	# jobs
  	PS1S="${PS1S}%{$fg[red]%}%(2v.%B%n%b.%n)%{$reset_color%}"
  elif [ "$(id -un)" != "eivind" ]; then
  	# We are running as a foreign user, include username, and make it bold
	# for jobs.
  	PS1S="${PS1S}%(2v.%B%n%b.%n)"
	has_userhost=true
  else
	# Otherwise, just do a space on a green background for that particular case
  	PS1S="${PS1S}%(2v.%{$bg[green]%} %{$reset_color%}.)"
  	#PS1S="${PS1S}%(2v. .)"
  fi
  if [ "$(hostname)" != "ws.openvcs.org" ]; then
  	# We are running on a foreign machine, print out hostname
  	PS1S="${PS1S}(%m)"
	delimiter=""
	has_userhost=true
  fi
  # Always include homedir and prompt, both bold.  Do magic around delimiters.
  if [ "$has_userhost" != "" ]; then
  	PS1="${PS1S}${delimiter}%B%~%#%b${PS1E} "
  else
  	PS1="${PS1S}%B%~%#%b${PS1E} "
  fi

  prompt_opts=( cr subst percent )
  precmd () { prompt_ee_precmd }
  preexec () { }
}

  #PS1='[%(2L.%L/.)'$ZSH_VERSION']%(?..%B{%v}%b)%n%(2v.%B@%b.@)%m:%B%~%b%(!.#.>) '
autoload -U colors
colors
#PS1='%(2L.[%L].)%(?..%B{%v}%b)%(2v.%BJ%b.)%B%~%#%b '
#PS1='%(2L.[%L].)%(?..%B{%v}%b)%(2v. .)%B%~%#%b '


