Isn't that printing the time the prompt was printed (the time the previous command finished)?
This is printing the time you pressed Enter (the time the command started), which is harder and less common, since that's not when the prompt is printed.
This is printing the time you pressed Enter (the time the command started), which is harder and less common, since that's not when the prompt is printed.
Instead, this seems to work:
TRAPDEBUG() {
case "$WIDGET" in
zle-line-finish)
zle reset-prompt
;;
*)
;;
esac
}
(I don't know if further cases will be required.)This updates the prompt after "enter" is pressed, but before the command is executed.