# -*- mode: sh -*-
#-
-# Copyright © 2015
+# Copyright © 2015, 2017
# mirabilos <thorsten.glaser@teckids.org>
#
# Provided that these terms and disclaimer and all copyright notices
isin_progress_bar=0
nlin_progress_bar=0
+if [[ $KSH_VERSION = @(\@\(#\)MIRBSD KSH R)@(5[5-9]|[6-9][0-9]|[1-9][0-9][0-9])\ * ]]; then
+ alias global='typeset -g'
+else
+ alias global=global
+fi
+
# args: $1 = number of draw_progress_bar calls to make up 100%
function init_progress_bar {
global -i _cnt_progress_bar=$1 _cur_progress_bar=0
print -n "\\n\\e[A\\e7\\e[1;$((# nlin_progress_bar - 1))r\\e8"
}
+unalias global
+
function sigwinch_progress_bar {
(( isin_progress_bar )) || return 0