Add output abstraction and reorganize profile

* Moves ColorSystem from Profile to Capabilities
* Renames Tty to IsTerminal
* Adds IAnsiConsoleOutput to make output more flexible

Closes #343
Closes #359
Closes #369
This commit is contained in:
Patrik Svensson
2021-04-12 18:15:21 +02:00
committed by Phil Scott
parent bc9f610258
commit 3e2eea730b
27 changed files with 194 additions and 139 deletions

View File

@ -13,11 +13,6 @@ namespace Spectre.Console
public ConsoleKeyInfo ReadKey(bool intercept)
{
if (_profile.Capabilities.Tty)
{
throw new InvalidOperationException("Cannot read input from a TTY console.");
}
if (!_profile.Capabilities.Interactive)
{
throw new InvalidOperationException("Failed to read input in non-interactive mode.");