Home » Uncategorized » My Oh-my-ZSH theme (with command run date output)

My Oh-my-ZSH theme (with command run date output)

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:
http://pastebin.com/cUvrbsgv

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)

MVMn Oh-my-ZSH theme 2.1.1

UPD: My OhMyZSH themes are now on GitHub – github.com/mvmn/dotfiles/tree/master/.oh-my-zsh/themes

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s