Add right prompt with duration and rc

This commit is contained in:
Loic Nageleisen 2023-04-20 15:29:16 +02:00
parent d847fb297b
commit 3c3b89831b
Signed by: lloeki
GPG key ID: D05DAEE6889F94C2
2 changed files with 24 additions and 1 deletions

13
zsh/rc
View file

@ -23,8 +23,18 @@ GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWSTASHSTATE=1
GIT_PS1_SHOWUNTRACKEDFILES=1
zmodload zsh/datetime
precmd() {
LAST_CMD_RC=$?
CMD_RC=$?
if [[ -n ${CMD_START} ]]; then
CMD_END="${EPOCHREALTIME}"
CMD_DURATION=$(( ${CMD_END} - ${CMD_START} ))
unset CMD_START
unset CMD_END
fi
_direnv_hook
psvar=()
set_prompt
@ -33,6 +43,7 @@ precmd() {
preexec() {
set_term_title
CMD_START="${EPOCHREALTIME}"
}
chpwd() {