Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 538 Bytes

README.md

File metadata and controls

30 lines (22 loc) · 538 Bytes

csharp-isatty

isatty for c#, It is heavily inspired by the Go library go-isatty.

Usage

using IsATeletypewriter;

var stdout = Console.OpenStandardOutput();
var fd = stdout.GetFileDescriptor();

if (SystemIsATeletypewriter.Instance.IsCygwinTerminal(fd))
{
    Console.WriteLine("Is Cygwin/MSYS2 Terminal");
}
else if (SystemIsATeletypewriter.Instance.IsTerminal(fd))
{
    Console.WriteLine("Is Terminal");
}
else
{
    Console.WriteLine("Is Not Terminal");
}

License

MIT