Task

Demonstrate how to check whether the output device is a terminal or not.



Related task

   Check input device is a terminal


using System;
 
namespace CheckTerminal {
    class Program {
        static void Main(string[] args) {
            Console.WriteLine("Stdout is tty: {0}", Console.IsOutputRedirected);
        }
    }
}