From 61370f555dff45f0853e425906e34235d64182d1 Mon Sep 17 00:00:00 2001 From: Erin Date: Wed, 18 Jan 2023 14:01:15 -0500 Subject: [PATCH] Use print -P for time to prevent changing on ^L --- zsh/.config/zsh/config.d/30_rprompt.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zsh/.config/zsh/config.d/30_rprompt.zsh b/zsh/.config/zsh/config.d/30_rprompt.zsh index d091afe..99dba83 100644 --- a/zsh/.config/zsh/config.d/30_rprompt.zsh +++ b/zsh/.config/zsh/config.d/30_rprompt.zsh @@ -33,8 +33,10 @@ function build_rprompt { fi fi - # add current time, including timezone if remote, and collapse it if we're out of room - RPROMPT="%<#<$RPROMPT at %D{%T$([ -n "$is_remote" ] && echo ' %Z')}" + # add exit time, including timezone if remote, and collapse it if we're out of room + timeformat="%D{%T$([ -n "$is_remote" ] && echo ' %Z')}" + exittime="$(print -P "$timeformat")" + RPROMPT="$RPROMPT at $exittime" # that's an RPROMPT! export RPROMPT