From 573a2e930dccd330bf5b66098b1d488ba06624fb Mon Sep 17 00:00:00 2001 From: chesteryue Date: Tue, 10 Nov 2020 00:37:48 +0800 Subject: [PATCH] [A] COMMAND_RESULT --- passion.zsh-theme | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/passion.zsh-theme b/passion.zsh-theme index 02de94e..c43b8bd 100644 --- a/passion.zsh-theme +++ b/passion.zsh-theme @@ -53,13 +53,16 @@ function update_command_status() { local arrow=""; local color_reset="%{$reset_color%}"; local reset_font="%{$fg_no_bold[white]%}"; - if $1; + COMMAND_RESULT=$1; + if $COMMAND_RESULT; then arrow="%{$fg_bold[red]%}❱%{$fg_bold[yellow]%}❱%{$fg_bold[green]%}❱"; else arrow="%{$fg_bold[red]%}❱❱❱"; fi COMMAND_STATUS="${arrow}${reset_font}${color_reset}"; + echo $COMMAND_RESULT + export COMMAND_RESULT=$COMMAND_RESULT } update_command_status true; @@ -182,4 +185,4 @@ TRAPALRM() { # prompt -PROMPT='$(real_time) $(directory) $(git_status)$(command_status) '; \ No newline at end of file +PROMPT='$(real_time) $(directory) $(git_status)$(command_status) ';