BenchmarkDotNet
BenchmarkDotNet copied to clipboard
Running on Linux leaves terminal colors changed
After running BDN on Linux I see my terminal colors modified.
SSH via PuTTY with xterm, .NET 6, BDN 0.13.2, Ubuntu 18.04. (Similar results were seen with xterm-256color)
- A successful run leaves the foreground color as yellow.
- A filter that has no matches, and no suggestions, leaves the foreground color as red.
- A filter that has no matches, and some suggestions, seems to leave the foreground color alone.
- Using
[DisassemblyDiagnoser], which yieldsUnknown Acknowledgmentfailures, leaves the foreground color as yellow. - The benchmark throwing an exception leaves the foreground color as yellow.
It's hard to say how many of those yellows are the same, of course.
Filter mismatch:

Successful run start:

Successful run end:

Looking at the pictures again... it may be "the terminal foreground becomes whatever color was the first one written"
The Unknown Acknowledgment error is #2070
Hint for potential contributor who wants to work on it: we revert the colors here:
https://github.com/dotnet/BenchmarkDotNet/blob/63e28c100a42a6492d09a0b93a8a4c141061bb0d/src/BenchmarkDotNet/Loggers/ConsoleLogger.cs#L44-L58
and this is most likely the part of the code that needs to be fixed.
I would like to work on this. please assign it to me.
I would like to work on this. please assign it to me.
@farQtech done! Please let me know if you need any help
Sure @adamsitnik , thanks!!
Hi @adamsitnik sorry for the delay, raised PR #2160 to fix above problem. I think it would be better if we restore ForegroundColor to it's original value once we are done. Please let me know your thoughts on this.
Fixed by #2160, thanks a lot @farQtech !