diff --git a/cmd/update.go b/cmd/update.go index 1fdfdbb..232c79e 100644 --- a/cmd/update.go +++ b/cmd/update.go @@ -24,6 +24,10 @@ func Update(cmd *cobra.Command, args []string) { slog.Error("Failed releasing lock") } }() + // Disables the loading icon on the terminal + defer print("\033]9;4;0\a") + // Clears up any previous loading icon + print("\033]9;4;0\a") hwCheck, err := cmd.Flags().GetBool("hw-check") if err != nil { diff --git a/lib/percentmanager.go b/lib/percentmanager.go index 24ca758..57ed8f3 100644 --- a/lib/percentmanager.go +++ b/lib/percentmanager.go @@ -3,6 +3,7 @@ package lib import ( "fmt" "log/slog" + "math" "time" "github.com/jedib0t/go-pretty/v6/progress" @@ -61,6 +62,8 @@ type TrackerMessage struct { } func ChangeTrackerMessageFancy(writer progress.Writer, tracker *IncrementTracker, progress bool, message TrackerMessage) { + percentage := math.Round((float64(tracker.Tracker.Value()) / float64(tracker.Tracker.Total)) * 100) + fmt.Printf("\033]9;4;1;%d\a", int(percentage)) if !progress { slog.Info("Updating", slog.String("title", message.Title),