Method IsAttachedToTerminal
IsAttachedToTerminal(out bool, out bool)
Determines whether the process is attached to a real terminal (i.e. stdin/stdout are connected to a console device rather than redirected or running inside a test harness). Set the environment variable "DisableRealDriverIO=1" to skip real terminal detection and force this method to return false, which is required for running in test harnesses that do not have a real terminal attached.
public static bool IsAttachedToTerminal(out bool inputAttached, out bool outputAttached)
Parameters
inputAttachedboolWhen this method returns, true if standard input is connected to a console device; otherwise false.
outputAttachedboolWhen this method returns, true if standard output is connected to a console device; otherwise false.