Skip to content
ConsoleMonster

API Reference

Class

TerminalEnvironment

Namespace ConsoleMonster.Capabilities
Assembly ConsoleMonster
Modifiers sealed

An immutable snapshot of the process inputs used by capability detection.

Inheritance

  • Object
  • TerminalEnvironment

Usage

Explore 2 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 1

Accepted by parameters 1

Constructors

public TerminalEnvironment(IReadOnlyDictionary<String, String>? environmentVariables = null, Boolean isOutputRedirected = false, Boolean isWindows = false, Int32 windowsBuild = 0, Boolean isConsoleHandle = false, Boolean? virtualTerminalEnabled = null, String? consoleFontFace = null, Boolean consoleFontIsRaster = false, Int32 windowWidth = 0, Int32 windowHeight = 0, Boolean isInputRedirected = false) #

Creates a snapshot, copying variables with the platform's name comparison.

Parameters

environmentVariables System.Collections.Generic.IReadOnlyDictionary<System.String, System.String>? = null optionalposition: 0
Environment variables; absent entries behave as empty strings.
isOutputRedirected System.Boolean = false optionalposition: 1
Whether stdout is redirected.
isWindows System.Boolean = false optionalposition: 2
Whether the host is Windows.
windowsBuild System.Int32 = 0 optionalposition: 3
Windows build number, or zero when unknown.
isConsoleHandle System.Boolean = false optionalposition: 4
Whether GetConsoleMode succeeded for stdout.
virtualTerminalEnabled System.Boolean? = null optionalposition: 5
Result of enabling VT, or null when not attempted.
consoleFontFace System.String? = null optionalposition: 6
Console font face, if available.
consoleFontIsRaster System.Boolean = false optionalposition: 7
Whether the font is raster.
windowWidth System.Int32 = 0 optionalposition: 8
Visible columns, or zero when unavailable.
windowHeight System.Int32 = 0 optionalposition: 9
Visible rows, or zero when unavailable.
isInputRedirected System.Boolean = false optionalposition: 10
Whether standard input is redirected.

Methods

public static TerminalEnvironment Capture() #
Returns: TerminalEnvironment

Captures real process inputs, enabling Windows VT output without changing code pages.

Returns

A snapshot for deterministic detection.

Properties

public IReadOnlyDictionary<String, String> EnvironmentVariables { get; } #

Copied environment variables, case-insensitive on Windows.

public Boolean IsOutputRedirected { get; } #

Whether stdout is redirected.

public Boolean IsWindows { get; } #

Whether the host is Windows.

public Int32 WindowsBuild { get; } #

Windows build, or zero when unknown.

public Boolean IsConsoleHandle { get; } #

Whether GetConsoleMode succeeded for stdout.

public Boolean? VirtualTerminalEnabled { get; } #

Result of enabling VT, or null when not attempted.

public String? ConsoleFontFace { get; } #

Console font face, when available.

public Boolean ConsoleFontIsRaster { get; } #

Whether the console font is raster.

public Int32 WindowWidth { get; } #

Visible columns, or zero when unavailable.

public Int32 WindowHeight { get; } #

Visible rows, or zero when unavailable.

public Boolean IsInputRedirected { get; } #

Whether standard input is redirected.