about summary refs log tree commit diff
path: root/Functions/Prompts/prompt_zefram_setup
blob: 99585edec3a8b0bc703839eb280cf0d31376d8fd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function prompt_zefram_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]=
}

function prompt_zefram_setup {
  PS1='[%(2L.%L/.)'$ZSH_VERSION']%(?..%B{%v}%b)%n%(2v.%B@%b.@)%m:%B%~%b%(!.#.>) '
  PS2='%(4_:... :)%3_> '

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

prompt_zefram_setup "$@"