Closed
Description
The SetTerminalForegroundRed and ResetTerminalForegroundColor methods of ConsoleExtensions can read the Platform.IsConsoleRedirectionCheckSupported and Console.IsOutputRedirected properties when deciding what to do. However, the value of Console.IsOutputRedirected has no effect in the end, because those methods execute the same code either way:
IsConsoleRedirectionCheckSupported | IsOutputRedirected | SetTerminalForegroundRed | ResetTerminalForegroundColor |
---|---|---|---|
true | false | sets Console.ForegroundColor | calls Console.ResetColor() |
true | true | sets Console.ForegroundColor | calls Console.ResetColor() |
false | not read | does nothing | does nothing |
That seems unintentional. If the behavior is correct, then at least the logic could be simplified.
Previously noted in #1850 (comment).