fix display of return code in prompt

This commit is contained in:
fatalerrors
2026-04-21 14:02:45 +02:00
parent d49703c5d5
commit 1dc5d72ac6

View File

@@ -311,13 +311,13 @@ set_prompt()
# Add exit status of the last command. # Add exit status of the last command.
# If it was successful, print a green check mark. Otherwise, print a red X. # If it was successful, print a green check mark. Otherwise, print a red X.
if [[ $Last_Command == 0 ]]; then if [[ $Last_Command == 0 ]]; then
PS1+="\[${_ok_fg}${_bar_bg}\] [ \$Last_Command " PS1+="\[${_ok_fg}${_bar_bg}\] [ $Last_Command "
PS1+="\[${_ok_mark}${_bar_bg}\]${Checkmark} " PS1+="\[${_ok_mark}${_bar_bg}\]${Checkmark} "
# Add the elapsed time, then close the status section and return to bar bg. # Add the elapsed time, then close the status section and return to bar bg.
timer_stop timer_stop
PS1+="($timer_show)\[${_ok_fg}${_bar_bg}\] ] " PS1+="($timer_show)\[${_ok_fg}${_bar_bg}\] ] "
else else
PS1+="\[${_err_fg}${_err_bg}\] [ \$Last_Command " PS1+="\[${_err_fg}${_err_bg}\] [ $Last_Command "
PS1+="\[${_err_mark}${_err_bg}\]${FancyX} " PS1+="\[${_err_mark}${_err_bg}\]${FancyX} "
timer_stop timer_stop
PS1+="($timer_show)\[${_err_fg}${_err_bg}\] ] " PS1+="($timer_show)\[${_err_fg}${_err_bg}\] ] "