# nice PS4 with elapsed seconds (to two decimal places) and subshell indication if zmodload zsh/system; then # to get actual pid setopt PROMPT_SUBST if (( ${terminfo[colors]:-0} >= 8 )); then # first color is for main shell process, second is subshell PS4_PID_COLORS=(cyan magenta) PS4='+%B${SECONDS} %F{${PS4_PID_COLORS[1+($$ != ${sysparams[pid]})]}}%N%f:%F{yellow}%i%f>%b ' else PS4='+%B${SECONDS} ${sysparams[pid]} %N:%i>%b ' fi # two digits after the decimal point typeset -g -F 2 SECONDS # typeset -F 2 SECONDS # do it twice, some bug I don't understand fi