diff --git a/plugins/progress/progress.plugin.sh b/plugins/progress/progress.plugin.sh index 7a4b88535..11958efb3 100644 --- a/plugins/progress/progress.plugin.sh +++ b/plugins/progress/progress.plugin.sh @@ -20,6 +20,8 @@ # Global variable to store progress value _omb_plugin_progress_value=0 +_omb_plugin_progress_clear_line= + # # Description : delay executing script # @@ -56,10 +58,13 @@ function progress { fi # Get a clear line escape sequence - local clear_line - clear_line=$(tput el 2>/dev/null || tput ce 2>/dev/null) + local clear_line=$_omb_plugin_progress_clear_line if [[ ! $clear_line ]]; then - clear_line=$'\e[K' + _omb_plugin_progress_clear_line=$(tput el 2>/dev/null || tput ce 2>/dev/null) + if [[ ! $_omb_plugin_progress_clear_line ]]; then + _omb_plugin_progress_clear_line=$'\e[K' + fi + clear_line=$_omb_plugin_progress_clear_line fi if ((_omb_plugin_progress_value <= 0 && value >= 0)); then printf "%s[............................] (0%%) %s\r" "$clear_line" "$message"; delay; fi