Use print -P for time to prevent changing on ^L
This commit is contained in:
parent
c9acb2bf4b
commit
61370f555d
|
@ -33,8 +33,10 @@ function build_rprompt {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# add current time, including timezone if remote, and collapse it if we're out of room
|
# add exit time, including timezone if remote, and collapse it if we're out of room
|
||||||
RPROMPT="%<#<$RPROMPT at %D{%T$([ -n "$is_remote" ] && echo ' %Z')}"
|
timeformat="%D{%T$([ -n "$is_remote" ] && echo ' %Z')}"
|
||||||
|
exittime="$(print -P "$timeformat")"
|
||||||
|
RPROMPT="$RPROMPT at $exittime"
|
||||||
|
|
||||||
# that's an RPROMPT!
|
# that's an RPROMPT!
|
||||||
export RPROMPT
|
export RPROMPT
|
||||||
|
|
Loading…
Reference in a new issue