site_zshenv_10_PS4 (589B)
1 # nice PS4 with ellapsed seconds (to two decimal places) 2 zmodload zsh/system # to get actual pid 3 zmodload zsh/terminfo # to get terminal color capability 4 setopt PROMPT_SUBST 5 if ((${terminfo[colors]:-0} >= 8)); then 6 # first color is for main shell process, second is subshell 7 typeset -g -a PS4_PID_COLORS 8 PS4_PID_COLORS=(cyan magenta) 9 PS4='+%B${SECONDS} %F{${PS4_PID_COLORS[1+($$ != ${sysparams[pid]})]}}%N%f:%F{yellow}%i%f>%b ' 10 else 11 PS4='+%B${SECONDS} ${sysparams[pid]} %N:%i>%b ' 12 fi 13 14 typeset -g -F 2 SECONDS # two digits after the decimal point 15 # vim: ft=zsh noet ts=4 sts=4 sw=4