Skip to content

Instantly share code, notes, and snippets.

@PaulCapestany
Created February 8, 2013 03:07
Show Gist options
  • Save PaulCapestany/4736311 to your computer and use it in GitHub Desktop.
Save PaulCapestany/4736311 to your computer and use it in GitHub Desktop.
oh-my-zsh prompt with continuously updated timestamp for every executed command ☺ (useful for troubleshooting server requests/responses when comparing against their logs, for example)
# oh-my-zsh prompt
PROMPT='%{$fg[white]%}%* ◀ %U%(0?.%{$fg_bold[magenta]%}.%{$fg_bold[red]%})%c%u %{$fg[white]%}▶ %{$reset_color%}'
PROMPT2=' %{$fg_bold[magenta]%}%c %{$fg_bold[white]%}… %_ %{$fg[white]%}▶ %{$reset_color%}'
# continuously updated timestamp for every executed command ☺
schedprompt() {
emulate -L zsh
zmodload -i zsh/sched
integer i=${"${(@)zsh_scheduled_events#*:*:}"[(I)schedprompt]}
(( i )) && sched -$i
zle && zle reset-prompt
sched +1 schedprompt
}
schedprompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment