RUN_VCS_INFO=
fi
+typeset -a longrun_data
+longrun_data=()
+# Display runtime in seconds for long running programs (> 60 seconds) and send
+# a bell to notify me.
+longrun_preexec() {
+ # Don't track the time for certain (possible) long running processes which
+ # need no automatic notification.
+ for ignore in elinks man mutt vim; do
+ case $3 in
+ $ignore | $ignore\ *)
+ longrun_data=()
+ return
+ ;;
+ esac
+ done
+
+ longrun_data=("$3" $EPOCHSECONDS)
+}
+longrun_precmd() {
+ # No previous timestamp available or disabled for this command, ignore.
+ if [[ -z $longrun_data ]]; then
+ return
+ fi
+
+ local difference=$(( EPOCHSECONDS - longrun_data[2] ))
+ if [[ $difference -gt 60 ]]; then
+ echo
+ echo -n "${fg[yellow]}"
+ echo -n "~> ${(V)longrun_data[1]} took $difference seconds."
+ echo -n "${fg[default]}"
+ echo "\a" # send bell
+ fi
+
+ # Clear status. Prevents displaying old status information when pressing
+ # enter with an empty command line.
+ longrun_data=()
+}
+preexec_functions+=(longrun_preexec)
+precmd_functions+=(longrun_precmd)
+
# Set the prompt. A two line prompt is used. On the top left the current
# working directory is displayed, on the right vcs_info (if available) and the
# current time in hex. On the bottom left current user name and host is shown,