addet blesh

This commit is contained in:
pika 2024-08-18 03:40:38 +02:00
parent 58205a50b9
commit 8c8d8e9962
302 changed files with 74275 additions and 0 deletions

View file

@ -0,0 +1,21 @@
# blesh/contrib/config/github296-named-execmark.bash (C) 2023, Koichi Murase <myoga.murase@gmail.com>
function ble/contrib/config:github296/named-execmark.hook {
local lastexit=$? command=$1
if ((lastexit)) && ! ble/string#match "$command" $'^[[:space:]]*#[^\n]+$'; then
local sgr=$'\e[;94m' sgr0=$'\e[m' sgrE=$'\e[;91m' ret
ble/color/face2sgr-ansi varname_number; local sgrN=$ret
local exit=$lastexit name=
if ((exit>=128)) && [[ ${name:=${_ble_builtin_trap_sig_name[exit&127]}} ]]; then
exit=$'\e[1m'"$name"$'\e[22m'" ($sgrN$exit$sgrE)"
else
exit="exit $sgrN$exit$sgrE"
fi
local mark=$sgrE'[ble: '$exit']'$sgr0
ble/util/buffer.print "$mark"
fi
}
bleopt exec_errexit_mark=
blehook POSTEXEC!=ble/contrib/config:github296/named-execmark.hook