From c07e94c6397d2a72b19292489c9b5027540f11f8 Mon Sep 17 00:00:00 2001 From: Erin Date: Sat, 15 Oct 2022 21:39:29 -0400 Subject: [PATCH] oops accidentally fucked up the prompt --- zsh/.config/zsh/config.d/30_rprompt.zsh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/zsh/.config/zsh/config.d/30_rprompt.zsh b/zsh/.config/zsh/config.d/30_rprompt.zsh index 3d5fa1b..1d3a1d4 100644 --- a/zsh/.config/zsh/config.d/30_rprompt.zsh +++ b/zsh/.config/zsh/config.d/30_rprompt.zsh @@ -7,24 +7,23 @@ function precmd { vcs_info # Start with a fresh prompt RPROMPT="" - some_line="" if [ -z $new_session ]; then # If this is the first prompt in a session, there's not much to say RPROMPT="%B%F{cyan}new session%f%b" new_session=1 else # Show exit code + more info about the last command run as a separate line - some_line="exited %B%(?.%F{green}%?%f.%F{red}%?%f)%b" + RPROMPT="exited %B%(?.%F{green}%?%f.%F{red}%?%f)%b" if [ -z $timer ]; then # If we never set $timer, preexec was never run (e.g. ^C at prompt) - some_line="$(print -P "%B%F{cyan}no exec%f%b, $some_line")" + RPROMPT=="$(print -P "%B%F{cyan}no exec%f%b, $RPROMPT")" else # Calculate elapsed real time for last command now="$(date +%s.%N)" if [[ $(($now - $timer)) > 0.5 ]]; then timer_show=$(($now - $timer)) timer_show=$(printf '%.*f\n' 3 $timer_show) - some_line="took %B%F{cyan}${timer_show}s%f%b, $some_line" + RPROMPT="took %B%F{cyan}${timer_show}s%f%b, $RPROMPT" fi fi fi