Skip to content

Commit

Permalink
Merge pull request #2368 from crazy-max/ansi-color
Browse files Browse the repository at this point in the history
Enhance ANSI colors for progress ui
  • Loading branch information
crazy-max authored Sep 24, 2021
2 parents deb1440 + 165e705 commit 1031116
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
6 changes: 3 additions & 3 deletions util/progress/progressui/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,11 @@ func (disp *display) print(d displayInfo, width, height int, all bool) {

out = align(out, timer, width)
if j.completedTime != nil {
color := aec.BlueF
color := colorRun
if j.isCanceled {
color = aec.YellowF
color = colorCancel
} else if j.hasError {
color = aec.RedF
color = colorError
}
out = aec.Apply(out, color)
}
Expand Down
12 changes: 12 additions & 0 deletions util/progress/progressui/term.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//go:build !windows
// +build !windows

package progressui

import "github.com/morikuni/aec"

var (
colorRun = aec.BlueF
colorCancel = aec.YellowF
colorError = aec.RedF
)
12 changes: 12 additions & 0 deletions util/progress/progressui/term_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//go:build windows
// +build windows

package progressui

import "github.com/morikuni/aec"

var (
colorRun = aec.CyanF
colorCancel = aec.YellowF
colorError = aec.RedF
)

0 comments on commit 1031116

Please sign in to comment.