I’ve decided to share my Oh-my-ZSH theme.
People used to have themes that include date/time in the prompt, but that’s only useful to know when command before prompt finished executing.
However, it doesn’t say much regarding time of command execution start.
For sure, if you open terminal and get prompt with 13:00:00 you can wait 5 minutes and then exec some command – for example echo or ls.
The command finishes, say, in 1 second, showing you 13:05:01 in new prompt. That lets you know when command finished. But not when it started.
I’ve added additional output of start datetime via preexec_functions hook of ZSH.
Here’s the code (moved to pastebing ’cause can’t get WordPress not to ruin slashes/backslashes )-: ) and a sample screenshot:
UPD: I’ve also fixed colorizing and moved end time to separate output (and also removed timestamp from prompt completely since it’s no longer useful to have it in prompt)
UPD: My OhMyZSH themes are now on GitHub – github.com/mvmn/dotfiles/tree/master/.oh-my-zsh/themes