mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 21:38:16 +08:00
Detect non-interactive console via System.Console.IsInputRedirected instead of Environment.UserInteractive
This commit is contained in:

committed by
Patrik Svensson

parent
2bd1383cbe
commit
90c2d988ab
@ -40,7 +40,7 @@ public sealed class AnsiConsoleFactory
|
||||
var interactive = settings.Interactive == InteractionSupport.Yes;
|
||||
if (settings.Interactive == InteractionSupport.Detect)
|
||||
{
|
||||
interactive = Environment.UserInteractive;
|
||||
interactive = !System.Console.IsInputRedirected;
|
||||
}
|
||||
|
||||
var profile = new Profile(output, encoding);
|
||||
|
Reference in New Issue
Block a user