Add an option for non-error exit status mark + customization #150
-
I'd like to see the exit status even when successful, possibly with a green color Also, i'd like to add an emoji to both error and non-error exits to make them more readable. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
If you want to print the exit status for both cases of successful execution and failure, you may turn off the exit-status display from ble.sh by setting an empty string to # blerc
# Turn off the exit status [ble: exit $?] by ble.sh
bleopt exec_errexit_mark=
# Print status
print-exit-status() {
local exit=$?
if ((exit==0)); then
echo $'status: \e[32m0 ♥\e[m'
else
echo $'status: \e[31m'"$exit"$' ♦\e[m'
fi
}
blehook POSTEXEC=print-exit-status |
Beta Was this translation helpful? Give feedback.
-
thank you, it is working as expected, i've made some changes to better suits my tastes (that's some tricky code to edit):
|
Beta Was this translation helpful? Give feedback.
If you want to print the exit status for both cases of successful execution and failure, you may turn off the exit-status display from ble.sh by setting an empty string to
bleopt exec_errexit_mark
and instead print one by yourself. You can print your own exit-status information via whatever you like such asblehook POSTEXEC
,PS1
, orPROMPT_COMMAND
. Here's an example usingblehook POSTEXEC
: