Class Driver
Holds global driver settings and cross-driver utility methods.
public sealed class Driver
- Inheritance
-
Driver
- Inherited Members
Constructors
Properties
- Force16Colors
Determines if driver instances should use 16 colors instead of the default TrueColors.
- SizeDetection
Controls how the ANSI driver detects the terminal's window size. Defaults to AnsiQuery, which sends a
CSI 18tANSI escape-sequence query to obtain the terminal size. Set to Polling to use a synchronous native syscall (ioctlon Unix, Console API on Windows) instead — useful when the ANSI query response does not reflect the remote terminal size (e.g., over an SSH tunnel).
Methods
- IsAttachedToTerminal(out bool, out bool)
Determines whether the process has a controlling terminal usable for TUI rendering and input. Returns true when either:
- stdin/stdout are connected to a console device, or
-
stdin/stdout are redirected (e.g. via a shell pipeline such as
result=$(myapp)ormyapp | jq) but a controlling terminal is available via/dev/ttyon Unix orCONIN$/CONOUT$on Windows.
Set the environment variable
DisableRealDriverIO=1to 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.
Events
- Force16ColorsChanged
Raised when Force16Colors changes.