Repository navigation
Closed
Labels
bugSomething isn't working
Description
During the rename from IsWasm to IsConsoleRedirectionCheckSupported in PR #498 the actual meaning of the value was inversed, but the code using it wasn't, which results in the current code being very much contradicting.
IsWasm = truewhen the accessorIsOutputRedirectedthrewIsConsoleRedirectionCheckSupported = trueis now when the exception is thrown, as well.
The code as it is works as expected, but any other person using this Platform API that doesn't check the actual implementation will use it exactly in the opposite way.
(text copied from my #498 (comment))
command-line-api/src/System.CommandLine/Platform.cs
Lines 6 to 26 in 0427856
| public static bool IsConsoleRedirectionCheckSupported | |
| { | |
| get | |
| { | |
| if (_isConsoleRedirectionCheckSupported == null) | |
| { | |
| try | |
| { | |
| var check = Console.IsOutputRedirected; | |
| _isConsoleRedirectionCheckSupported = false; | |
| } | |
| catch (PlatformNotSupportedException) | |
| { | |
| _isConsoleRedirectionCheckSupported = true; | |
| } | |
| } | |
| return _isConsoleRedirectionCheckSupported.Value; | |
| } | |
| } |
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
fix dotnet#656
fix dotnet#656
fix #656 (#676)