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
|
return
|
||||||
fi
|
fi
|
||||||
export HAVE_BASHTOOLS=1
|
export HAVE_BASHTOOLS=1
|
||||||
|
trap bashtools_cleanup INT
|
||||||
|
|
||||||
SPINDELAY=0.05 # delay in ms between spinner frames
|
SPINDELAY=0.05 # delay in ms between spinner frames
|
||||||
SPINNERFRAMES='|/-\'
|
SPINNERFRAMES='|/-\'
|
||||||
|
@ -152,6 +153,12 @@ function info() {
|
||||||
csecho "${INFOCOL}" "^b>>^p $*" >/dev/stderr
|
csecho "${INFOCOL}" "^b>>^p $*" >/dev/stderr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function bashtools_cleanup() {
|
||||||
|
stop_spinner
|
||||||
|
innotify=0
|
||||||
|
echo -e "$PLAIN"
|
||||||
|
}
|
||||||
|
|
||||||
function ok() {
|
function ok() {
|
||||||
local msg=${*:-ok}
|
local msg=${*:-ok}
|
||||||
stop_spinner
|
stop_spinner
|
||||||
|
|
Loading…
Reference in New Issue