diff options
| author | Rose Hogenson <rosehogenson@posteo.net> | 2025-04-18 15:48:08 -0700 |
|---|---|---|
| committer | Rose Hogenson <rosehogenson@posteo.net> | 2025-04-18 15:48:08 -0700 |
| commit | cdf2d155b484ef96527180435467e0b70b0ae8cf (patch) | |
| tree | 8be02de838d1dc23d2ae7df82b476bccf3b61eb5 /ccp.go | |
| parent | Handle lines longer than terminal width (diff) | |
| download | ccp-cdf2d155b484ef96527180435467e0b70b0ae8cf.tar.zst | |
Let errors scroll off the screen
Diffstat (limited to 'ccp.go')
| -rw-r--r-- | ccp.go | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -167,7 +167,7 @@ func run() error { case <-frameTimer.C: } - width, _, err := term.GetSize(int(os.Stdout.Fd())) + width, height, err := term.GetSize(int(os.Stdout.Fd())) if err != nil { width = 80 } @@ -175,7 +175,7 @@ func run() error { currentProgress.mu.Lock() current := currentProgress.current - max := currentProgress.max + maxBytes := currentProgress.max copyingFrom := currentProgress.copyingFrom copyingTo := currentProgress.copyingTo errs := currentProgress.errs @@ -193,8 +193,8 @@ func run() error { } } progress := 0. - if max > 0 { - progress = float64(current) / float64(max) + if maxBytes > 0 { + progress = float64(current) / float64(maxBytes) } etaStr := "..." if eta >= 0 { @@ -209,7 +209,7 @@ func run() error { copyingFile, bar.ViewAs(progress), etaStr) - for _, e := range errs { + for _, e := range errs[max(len(errs)-max(height-5, 0), 0):] { fmt.Fprintln(renderer, warningStyle(e.Error())) } renderer.Flush() |
