fix(iostreams): make coloured output work on Windows#625
fix(iostreams): make coloured output work on Windows#625craicoverflow merged 4 commits intoredhat-developer:mainfrom
Conversation
de77328 to
1ac1b51
Compare
c3d64ec to
0c92442
Compare
| activeMembersCount := cgutil.GetActiveConsumersCount(consumers) | ||
| partitionsWithLagCount := cgutil.GetPartitionsWithLag(consumers) | ||
|
|
||
| fmt.Fprintln(w, color.Bold(localizer.MustLocalizeFromID("kafka.consumerGroup.describe.output.activeMembers")), activeMembersCount, "\t", color.Bold(localizer.MustLocalizeFromID("kafka.consumerGroup.describe.output.partitionsWithLag")), partitionsWithLagCount) |
There was a problem hiding this comment.
Removed the bolding of text here because Command Prompt does not support ANSI colors. Powershell does and it worked fine though. Do we need to support both??
There was a problem hiding this comment.
Yes - if runtime.GOOS != "windows".
There was a problem hiding this comment.
I meant between powershell and cmd...
There was a problem hiding this comment.
Oh sorry, no I did not see a simple way..not using Go libraries anyway.
There was a problem hiding this comment.
That sucks. I guess we need to support both... I'm not sure how well adopted powershell actually is.
There was a problem hiding this comment.
Not sure either, it seems much better and has the same commands as Unix. Best to support both until we know for sure.
|
It's a lot of hassle to verify this, so I've added screenshots to help. |
|
Do we need this one before Summit? |
It depends - the output looks poor and does not give a good impression to Windows users. |
|
Aha -thanks for providing the for - I wasn't sure if it was just to enable colours on Windows! Yes, then we should do this. |
0dbe55a to
789b234
Compare

Fixes #621
Verification
Set up this project on a Windows machine, check out and run this PR from Command Prompt
OR
Check these screenshots.
Powershell

Cmd
