addet blesh
This commit is contained in:
parent
58205a50b9
commit
8c8d8e9962
302 changed files with 74275 additions and 0 deletions
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue