Table of Contents

Method IsAttachedToTerminal

Namespace
Terminal.Gui.Drivers
Assembly
Terminal.Gui.dll

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

inputAttached bool

When this method returns, true if standard input is connected to a console device; otherwise false.

outputAttached bool

When this method returns, true if standard output is connected to a console device; otherwise false.

Returns

bool

true if both input and output are attached to a terminal; otherwise false.