trap sigint so that spinner isnt left running
This commit is contained in:
parent
b887074869
commit
bba12d9d81
|
@ -40,6 +40,7 @@ if [[ $1 != "reload" && -n $HAVE_BASHTOOLS ]]; then
|
|||
return
|
||||
fi
|
||||
export HAVE_BASHTOOLS=1
|
||||
trap bashtools_cleanup INT
|
||||
|
||||
SPINDELAY=0.05 # delay in ms between spinner frames
|
||||
SPINNERFRAMES='|/-\'
|
||||
|
@ -152,6 +153,12 @@ function info() {
|
|||
csecho "${INFOCOL}" "^b>>^p $*" >/dev/stderr
|
||||
}
|
||||
|
||||
function bashtools_cleanup() {
|
||||
stop_spinner
|
||||
innotify=0
|
||||
echo -e "$PLAIN"
|
||||
}
|
||||
|
||||
function ok() {
|
||||
local msg=${*:-ok}
|
||||
stop_spinner
|
||||
|
|
Loading…
Reference in New Issue