I would like tcsh to print the time that each command is executed, preferably in the right-hand column of the screen. This is similar to what
rprompt can be used to do with the following setting,
set rprompt = "%P"
except that the above prints the time when the prompt was printed on the screen, not the time that the next command is executed. I find this unhelpful; If I haven't typed a command for some time, and then execute a command, the time printed next to the command does not reflect when I executed that command. I thought that the following would do it,
alias postcmd 'set rprompt="`date +%T`"'
by dynamically changing the value of
rprompt before each command is executed, but this also doesn't do it; it does not update the time to the time when the command is executed. (And actually, I don't understand why.) Setting
precmd doesn't do it either.
How can I accomplish this?
My question is essentially identical to this question, except that I use tcsh and not bash, and the other question's accepted answer (i.e., setting
precmd) does not appear to work for me.