From 3f0ea78b86f438972bd469e27630501fc024e579 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 23 Nov 2014 14:34:18 +0100 Subject: [PATCH] Clear line with ANSI escape on update --- cmd/khepri/cmd_backup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/khepri/cmd_backup.go b/cmd/khepri/cmd_backup.go index 97b50243f..c81bb43a5 100644 --- a/cmd/khepri/cmd_backup.go +++ b/cmd/khepri/cmd_backup.go @@ -109,7 +109,7 @@ func commandBackup(be backend.Server, key *khepri.Key, args []string) error { go func(ch <-chan khepri.Stats) { status := func(d time.Duration) { - fmt.Printf("\r[%s] %3.2f%% %s/s %s / %s ETA %s", + fmt.Printf("\x1b[2K\r[%s] %3.2f%% %s/s %s / %s ETA %s", format_duration(uint64(d/time.Second)), float64(stats.Bytes)/float64(arch.Stats.Bytes)*100, format_bytes(bps),