File: prompt_zefram_setup

package info (click to toggle)
zsh-beta 4.3.17-dev-0%2B20120621-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 19,804 kB
  • sloc: ansic: 95,966; sh: 5,899; makefile: 845; perl: 745; awk: 383; sed: 16
file content (19 lines) | stat: -rw-r--r-- 509 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function prompt_zefram_precmd {
	local exitstatus=$?
	setopt localoptions noxtrace noksharrays
	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 )

  add-zsh-hook precmd prompt_zefram_precmd
}

prompt_zefram_setup "$@"