2020-11-19 12:24:04 +01:00

18 lines
430 B
C#

using System;
namespace Spectre.Console.Internal
{
internal sealed class ConsoleInput : IAnsiConsoleInput
{
public ConsoleKeyInfo ReadKey(bool intercept)
{
if (!Environment.UserInteractive)
{
throw new InvalidOperationException("Failed to read input in non-interactive mode.");
}
return System.Console.ReadKey(intercept);
}
}
}