Skip to content

Commit

Permalink
Detect non-interactive console via System.Console.IsInputRedirected i…
Browse files Browse the repository at this point in the history
…nstead of Environment.UserInteractive
  • Loading branch information
bastianeicher authored and patriksvensson committed Aug 29, 2022
1 parent 2bd1383 commit 90c2d98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Spectre.Console/AnsiConsoleFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public IAnsiConsole Create(AnsiConsoleSettings settings)
var interactive = settings.Interactive == InteractionSupport.Yes;
if (settings.Interactive == InteractionSupport.Detect)
{
interactive = Environment.UserInteractive;
interactive = !System.Console.IsInputRedirected;
}

var profile = new Profile(output, encoding);
Expand Down

0 comments on commit 90c2d98

Please sign in to comment.