fixed return value display
This commit is contained in:
parent
9993d2c020
commit
a119d1fe2e
29
.zshrc
29
.zshrc
@ -6,10 +6,12 @@
|
|||||||
DEFAULT_USER="nivertius"
|
DEFAULT_USER="nivertius"
|
||||||
EDITOR="vim"
|
EDITOR="vim"
|
||||||
|
|
||||||
#---------------------------------- Setup -------------------------------------
|
#---------------------------------- Pre Setup ---------------------------------
|
||||||
|
|
||||||
autoload colors; colors
|
autoload colors; colors
|
||||||
|
|
||||||
|
LAST_RETURN_VALUE=0
|
||||||
|
|
||||||
#---------------------------------- Tab completion ----------------------------
|
#---------------------------------- Tab completion ----------------------------
|
||||||
|
|
||||||
# Force a reload of completion system if nothing matched; this fixes installing
|
# Force a reload of completion system if nothing matched; this fixes installing
|
||||||
@ -175,15 +177,22 @@ prompt_dir() {
|
|||||||
prompt_status() {
|
prompt_status() {
|
||||||
local symbols
|
local symbols
|
||||||
symbols=()
|
symbols=()
|
||||||
[[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}$CROSS"
|
if [[ $LAST_RETURN_VALUE -ne 0 ]]; then
|
||||||
[[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}$GEAR"
|
symbols+="%{%F{red}%}$CROSS"
|
||||||
|
if [[ $LAST_RETURN_VALUE -ne 1 ]]; then
|
||||||
[[ -n "$symbols" ]] && prompt_segment $PRIMARY_FG default " $symbols "
|
symbols+="$CROSS $CROSS"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [[ $(jobs -l | wc -l) -gt 0 ]]; then
|
||||||
|
symbols+="%{%F{cyan}%}$GEAR"
|
||||||
|
fi
|
||||||
|
if [[ -n "$symbols" ]]; then
|
||||||
|
prompt_segment $PRIMARY_FG default " $symbols "
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
## Main prompt
|
## Main prompt
|
||||||
prompt_main() {
|
prompt_main() {
|
||||||
RETVAL=$?
|
|
||||||
CURRENT_BG='NONE'
|
CURRENT_BG='NONE'
|
||||||
prompt_status
|
prompt_status
|
||||||
prompt_root
|
prompt_root
|
||||||
@ -361,6 +370,14 @@ REPORTTIME=5
|
|||||||
for command in find wget; \
|
for command in find wget; \
|
||||||
alias $command="noglob $command"
|
alias $command="noglob $command"
|
||||||
|
|
||||||
|
#---------------------------------- Post Setup --------------------------------
|
||||||
|
|
||||||
|
store_last_return_value() {
|
||||||
|
LAST_RETURN_VALUE="$?"
|
||||||
|
}
|
||||||
|
|
||||||
|
precmd_functions=(store_last_return_value $precmd_functions)
|
||||||
|
|
||||||
#---------------------------------- Machine specific --------------------------
|
#---------------------------------- Machine specific --------------------------
|
||||||
|
|
||||||
if [[ -r $HOME/.zlocal ]]; then
|
if [[ -r $HOME/.zlocal ]]; then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user