From: afresh1 Date: Thu, 21 Mar 2024 01:02:29 +0000 (+0000) Subject: Clear spinner after each cycle X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0e3a089704531566fe801a6b4426edc1a4c79e8f;p=openbsd Clear spinner after each cycle Otherwise we can get left with a piece of the spinner if all firmware gets updates and don't print a "kept" value. While here, replace \010 with the ksh supported \b, as suggested by cheloha@ Noticed by deraadt@ --- diff --git a/usr.sbin/fw_update/fw_update.sh b/usr.sbin/fw_update/fw_update.sh index 4be63c8a351..912f86ad9b9 100644 --- a/usr.sbin/fw_update/fw_update.sh +++ b/usr.sbin/fw_update/fw_update.sh @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: fw_update.sh,v 1.55 2023/11/15 02:07:43 afresh1 Exp $ +# $OpenBSD: fw_update.sh,v 1.56 2024/03/21 01:02:29 afresh1 Exp $ # # Copyright (c) 2021,2023 Andrew Hewus Fresh # @@ -100,9 +100,10 @@ spin() { { for p in '/' '-' '\\' '|' '/' '-' '\\' '|'; do - echo -n "$p"'\010' + echo -n "$p"'\b' sleep 0.125 done + echo -n " "'\b' }>/dev/tty }