diff options
| -rw-r--r-- | TODO.md | 1 | ||||
| -rw-r--r-- | internal/clients/stats.go | 6 | ||||
| -rw-r--r-- | internal/color/brush/brush.go | 14 | ||||
| -rw-r--r-- | internal/color/paint.go | 5 | ||||
| -rw-r--r-- | internal/config/client.go | 4 |
5 files changed, 11 insertions, 19 deletions
@@ -14,3 +14,4 @@ This is a loose list of what to do. Maybe for the next releae or maybe for a lat [ ] Implement Benchmark cat-ing a file and compare to prev version. [x] Client 4.x should print a warning when trying to connect to a 3.x server. [ ] Update docs for color configuration +[ ] Update animated gifs diff --git a/internal/clients/stats.go b/internal/clients/stats.go index 3f76e0f..faeb9fb 100644 --- a/internal/clients/stats.go +++ b/internal/clients/stats.go @@ -80,9 +80,9 @@ func (s *stats) printStatsDueInterrupt(messages []string) { for i, message := range messages { if i > 0 && config.Client.TermColorsEnable { fmt.Println(color.PaintStrWithAttr(message, - config.Client.TermColors.Client.TextFg, - config.Client.TermColors.Client.TextBg, - config.Client.TermColors.Client.TextAttr, + config.Client.TermColors.Client.ClientFg, + config.Client.TermColors.Client.ClientBg, + config.Client.TermColors.Client.ClientAttr, )) continue } diff --git a/internal/color/brush/brush.go b/internal/color/brush/brush.go index 785a0d0..524829b 100644 --- a/internal/color/brush/brush.go +++ b/internal/color/brush/brush.go @@ -183,19 +183,6 @@ func Colorfy(line string) string { case strings.HasPrefix(line, "SERVER"): paintServer(&sb, line) - /* - case strings.Contains(line, "ERROR"): - color.PaintWithAttr(&sb, line, - config.Client.TermColors.ClientErrorFg, - config.Client.TermColors.ClientErrorBg, - config.Client.TermColors.ClientErrorAttr) - - case strings.Contains(line, "WARN"): - color.PaintWithAttr(&sb, line, - config.Client.TermColors.ClientWarnFg, - config.Client.TermColors.ClientWarnBg, - config.Client.TermColors.ClientWarnAttr) - */ default: color.PaintWithAttr(&sb, line, color.FgDefault, @@ -203,6 +190,5 @@ func Colorfy(line string) string { color.AttrNone) } - color.ResetWithAttr(&sb) return sb.String() } diff --git a/internal/color/paint.go b/internal/color/paint.go index 2798ff7..5430acd 100644 --- a/internal/color/paint.go +++ b/internal/color/paint.go @@ -38,6 +38,8 @@ func Paint(sb *strings.Builder, text string, fg FgColor, bg BgColor) { sb.WriteString(string(fg)) sb.WriteString(string(bg)) sb.WriteString(text) + sb.WriteString(string(BgDefault)) + sb.WriteString(string(FgDefault)) } // Reset background and foreground colors. @@ -56,6 +58,9 @@ func PaintWithAttr(sb *strings.Builder, text string, fg FgColor, bg BgColor, att sb.WriteString(string(bg)) sb.WriteString(string(attr)) sb.WriteString(text) + sb.WriteString(string(AttrReset)) + sb.WriteString(string(BgDefault)) + sb.WriteString(string(FgDefault)) } // ResetWithAttr resets background, foreground and attributes. diff --git a/internal/config/client.go b/internal/config/client.go index 8bde7a4..3c2f7de 100644 --- a/internal/config/client.go +++ b/internal/config/client.go @@ -99,7 +99,7 @@ func newDefaultClientConfig() *ClientConfig { RemoteFg: color.FgWhite, CountAttr: color.AttrDim, CountBg: color.BgBlue, - CountFg: color.FgGreen, + CountFg: color.FgWhite, HostnameAttr: color.AttrBold, HostnameBg: color.BgBlue, HostnameFg: color.FgWhite, @@ -108,7 +108,7 @@ func newDefaultClientConfig() *ClientConfig { IdFg: color.FgWhite, StatsOkAttr: color.AttrNone, StatsOkBg: color.BgGreen, - StatsOkFg: color.FgBlue, + StatsOkFg: color.FgBlack, StatsWarnAttr: color.AttrNone, StatsWarnBg: color.BgRed, StatsWarnFg: color.FgWhite, |
