TerminalProfile
ConsoleMonster.Capabilities
An immutable description of what the current terminal can do. Produced by an ICapabilityProvider, overridable by code, environment variables (CONSOLEMONSTER_COLOR, CONSOLEMONSTER_GLYPHS, CONSOLEMONSTER_MODE, CONSOLEMONSTER_THEME, CONSOLEMONSTER_HYPERLINKS, NO_COLOR) and configuration. Rendering is a pure function of the widget, its state, this profile and the theme.
Inheritance
- object
- TerminalProfile
Usage
Explore 79 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 40
- Property RenderContext.Profile
- Method CapabilityDetector.Detect
- Method CapabilityDetector.RefreshFont
- Method ICapabilityProvider.Detect
- Method TerminalProfile.Fixed
- Method TerminalProfile.WithBorder
- Method TerminalProfile.WithColorDepth
- Method TerminalProfile.WithCulture
- Method TerminalProfile.WithDecision
- Method TerminalProfile.WithDefaultColors
- Method TerminalProfile.WithDensity
- Method TerminalProfile.WithGlyphs
- Method TerminalProfile.WithHyperlinks
- Method TerminalProfile.WithImageProtocol
- Method TerminalProfile.WithLanguage
- Method TerminalProfile.WithMode
- Method TerminalProfile.WithPalette
- Method TerminalProfile.WithPlainOutput
- Method TerminalProfile.WithRedirectedOutput
- Method TerminalProfile.WithSize
- Method TerminalProfile.WithStatusMarkers
- Method TerminalProfile.WithThemeMode
- Method TerminalProfile.WithWidthProfile
- Property ConsoleMonsterLoggerOptions.Profile
- Property ConsoleMonsterTarget.Profile
- Property ConsoleMonsterSinkOptions.Profile
- Property HeadlessTerminal.Profile
- Property InteractiveOptions.Profile
- Property LiveSessionOptions.Profile
- Property LogTailOptions.Profile
- Property ConsoleTarget.Profile
- Property ITerminalTarget.Profile
- Property NullTarget.Profile
- Property RecordingTarget.Profile
- Property WriterTarget.Profile
- Property PromptContext.Terminal
- Property ITerminalOutput.Profile
- Method Terminal.GetCurrentProfile
- Property Terminal.Profile
- Method TestTerminal.Profile
Accepted by parameters 39
- Constructor RenderContext.RenderContext
- Method CapabilityDetector.RefreshFont
- Extension method ConsoleMonsterLoggerOptions.Profile
- Method ConsoleMonsterLoggerOptionsFluent.Profile
- Method ConsoleImage.Write
- Extension method InteractiveOptions.Profile
- Method InteractiveOptionsFluent.Profile
- Extension method IWidget.Show
- Constructor InlineArea.InlineArea
- Method InlineArea.IsSupported
- Extension method LiveSessionOptions.Profile
- Method LiveSessionOptionsFluent.Profile
- Extension method LogTailOptions.Profile
- Method LogTailOptionsFluent.Profile
- Constructor RecordingTarget.RecordingTarget
- Method StatusLine.Show
- Method TaskbarProgress.IsSupported
- Constructor WriterTarget.WriterTarget
- Constructor PromptContext.PromptContext
- Method ConsoleColorMap.ColorDisabled
- Extension method StatusKind.ToWord
- Method StatusKinds.ToWord
- Method Terminal.CreateContext
- Method Terminal.CreateInlineOutput
- Method Terminal.CreateOutput
- Method Terminal.Render
- Method Terminal.RenderEncoded
- Method Terminal.RenderText
- Method Terminal.ResolveTheme
- Method Terminal.UseProfilePolicy
- Method Terminal.Write
- Method Terminal.WriteLines
- Method Terminal.WriteMarkup
- Method Terminal.WriteMarkupLine
- Method Terminal.WriteRich
- Method UiConstruction.Show
- Method WidgetPipeline.Show
- Extension method ChartOptions.Show
- Extension method ProgressOptions.Show
Constructors
public TerminalProfile(ColorDepth colorDepth, GlyphTier glyphs, OutputMode mode, int width, int height, TerminalKind kind, bool supportsVirtualTerminal, bool isOutputRedirected, bool isConsoleHandle, bool isContinuousIntegration, string? fontFace, IReadOnlyList<string>? decisions, TerminalWidthProfile? widthProfile, bool probeWidths, ThemeMode themeMode, CultureInfo? culture) #Creates a profile through the original constructor signature, retained for compiled consumers.
Parameters
- colorDepth ConsoleMonster.Capabilities.ColorDepth
- Colour fidelity.
- glyphs ConsoleMonster.Capabilities.GlyphTier
- Glyph tier.
- mode ConsoleMonster.Capabilities.OutputMode
- Output mode.
- width int
- Width in cells.
- height int
- Height in cells.
- kind ConsoleMonster.Capabilities.TerminalKind
- Detected terminal kind.
- supportsVirtualTerminal bool
- Whether VT sequences are understood.
- isOutputRedirected bool
- Whether standard output is redirected.
- isConsoleHandle bool
- Whether output goes to a real Windows console handle.
- isContinuousIntegration bool
- Whether a CI environment was detected.
- fontFace string?
- The console font face, when known.
- decisions System.Collections.Generic.IReadOnlyList<string>?
- Notes explaining the capability decisions.
- widthProfile ConsoleMonster.Text.TerminalWidthProfile?
- Display width assumptions.
- probeWidths bool
- Whether a live width probe is permitted.
- themeMode ConsoleMonster.ThemeMode
- Requested light, dark or automatic theme mode.
- culture System.Globalization.CultureInfo?
- Culture for numbers and dates, or null for the current culture.
public TerminalProfile(ColorDepth colorDepth, GlyphTier glyphs, OutputMode mode, int width = 100, int height = 40, TerminalKind kind = Unknown, bool supportsVirtualTerminal = false, bool isOutputRedirected = false, bool isConsoleHandle = false, bool isContinuousIntegration = false, string? fontFace = null, IReadOnlyList<string>? decisions = null, TerminalWidthProfile? widthProfile = null, bool probeWidths = false, ThemeMode themeMode = Auto, CultureInfo? culture = null, bool? supportsHyperlinks = null) #Creates a profile with explicit values. Tests and fixed-output scenarios use this directly.
Parameters
- colorDepth ConsoleMonster.Capabilities.ColorDepth
- Colour fidelity.
- glyphs ConsoleMonster.Capabilities.GlyphTier
- Glyph tier.
- mode ConsoleMonster.Capabilities.OutputMode
- Output mode.
- width int = 100
- Width in cells; values below 1 fall back to TerminalProfile.DefaultWidth.
- height int = 40
- Height in cells; values below 1 fall back to TerminalProfile.DefaultHeight.
- kind ConsoleMonster.Capabilities.TerminalKind = Unknown
- Detected terminal kind.
- supportsVirtualTerminal bool = false
- Whether VT sequences are understood.
- isOutputRedirected bool = false
- Whether standard output is redirected.
- isConsoleHandle bool = false
- Whether output goes to a real Windows console handle (written with WriteConsoleW).
- isContinuousIntegration bool = false
- Whether a CI environment was detected.
- fontFace string? = null
- The console font face, when known.
- decisions System.Collections.Generic.IReadOnlyList<string>? = null
- Human-readable notes explaining how each value was chosen.
- widthProfile ConsoleMonster.Text.TerminalWidthProfile? = null
- Configured or derived display width assumptions.
- probeWidths bool = false
- Whether a live width probe is permitted.
- themeMode ConsoleMonster.ThemeMode = Auto
- Requested light, dark or automatic theme mode.
- culture System.Globalization.CultureInfo? = null
- The culture for numbers and dates in rendered output, or null for the current culture.
- supportsHyperlinks bool? = null
- OSC 8 support, or null to infer it from the terminal kind. Redirected, CI, noninteractive and non-VT output always disable links.
Methods
public static TerminalProfile Fixed(int width, int height, ColorDepth colorDepth = TrueColor, GlyphTier glyphs = Full, OutputMode mode = Interactive) #A fixed profile for tests, snapshots and HTML-free documentation captures.
Parameters
- width int
- Width in cells.
- height int
- Height in cells.
- colorDepth ConsoleMonster.Capabilities.ColorDepth = TrueColor
- Colour fidelity.
- glyphs ConsoleMonster.Capabilities.GlyphTier = Full
- Glyph tier.
- mode ConsoleMonster.Capabilities.OutputMode = Interactive
- Output mode.
public override string ToString() #Returns a string that represents the current object.
Returns
string A string that represents the current object.public TerminalProfile WithBorder(BoxStyle? border) #Returns a copy that draws default frames with this style, whatever the theme says.
Parameters
- border ConsoleMonster.Glyphs.BoxStyle?
- The frame, or null to follow the theme. BoxStyle None is not a frame style.
public TerminalProfile WithColorDepth(ColorDepth colorDepth) #Returns a copy with a different colour depth.
Parameters
- colorDepth ConsoleMonster.Capabilities.ColorDepth
- The new colour depth.
public TerminalProfile WithCulture(CultureInfo? culture) #Returns a copy that renders numbers and dates with the given culture.
Parameters
- culture System.Globalization.CultureInfo?
- The culture, or null to follow the current culture.
public TerminalProfile WithDecision(string decision) #Returns a copy with an extra decision note appended.
Parameters
- decision string
- The note.
public TerminalProfile WithDefaultColors(Color foreground, Color background) #Returns a copy with explicit default colors for this rendering, including style and output resets.
Parameters
- foreground ConsoleMonster.Styling.Color
- The supplied host foreground, or Color.Default to keep VT defaults.
- background ConsoleMonster.Styling.Color
- The supplied host background, or Color.Default to keep VT defaults.
Returns
TerminalProfile A new profile. Explicit style colors still take precedence; Plain and color-disabled output emit no SGR.public TerminalProfile WithDensity(ThemeDensity? density) #Returns a copy with a density override, or null to use the theme.
Parameters
- density ConsoleMonster.Styling.ThemeDensity?
- The spacing density.
public TerminalProfile WithGlyphs(GlyphTier glyphs) #Returns a copy with a different glyph tier.
Parameters
- glyphs ConsoleMonster.Capabilities.GlyphTier
- The new glyph tier.
public TerminalProfile WithHyperlinks(bool supportsHyperlinks) #Returns a copy with OSC 8 support enabled or disabled. Output, CI, mode and VT guards still apply.
Parameters
- supportsHyperlinks bool
- Whether the terminal supports hyperlinks.
public TerminalProfile WithImageProtocol(ImageProtocol protocol) #Returns a copy that draws images with a chosen protocol, for a terminal detection does not recognise or to opt down to half blocks or the placeholder. Output, CI, mode, VT and colour guards still apply (see TerminalProfile.ImageProtocol).
Parameters
- protocol ConsoleMonster.Capabilities.ImageProtocol
- The protocol the terminal supports.
public TerminalProfile WithLanguage(CultureInfo? language) #Returns a copy whose built-in labels use the given language (see TerminalProfile.Language).
Parameters
- language System.Globalization.CultureInfo?
- The language, or null to follow the current UI culture.
public TerminalProfile WithMode(OutputMode mode) #Returns a copy with a different output mode.
Parameters
- mode ConsoleMonster.Capabilities.OutputMode
- The new mode.
public TerminalProfile WithPalette(ThemePalette palette) #Returns a copy with a different palette.
Parameters
- palette ConsoleMonster.Capabilities.ThemePalette
- The palette.
public TerminalProfile WithPlainOutput() #Returns this profile in plain mode, as CONSOLEMONSTER_MODE=plain gives: append-only ASCII lines without colour or escape sequences.
public TerminalProfile WithRedirectedOutput() #Returns this profile as detection would see it with standard output redirected to a file, pipe or log: append-only stream output (plain stays plain), no colour, no VT sequences or links, the Basic glyph tier at most, and a width that is only the layout default (TerminalProfile.IsWidthKnown is false). Hosts use it for a second destination, such as standard error, instead of building a profile by hand.
public TerminalProfile WithSize(int width, int height) #Returns a copy with a different size (used on resize).
Parameters
- width int
- Width in cells.
- height int
- Height in cells.
public TerminalProfile WithStatusMarkers(StatusMarkerStyle? markers) #Returns a copy that marks statuses this way, whatever the theme says.
Parameters
- markers ConsoleMonster.Styling.StatusMarkerStyle?
- The markers, or null to follow the theme.
public TerminalProfile WithThemeMode(ThemeMode themeMode) #Returns a copy with a different theme mode.
Parameters
- themeMode ConsoleMonster.ThemeMode
- Light, dark or automatic.
public TerminalProfile WithWidthProfile(TerminalWidthProfile profile) #Returns a copy with a different terminal width profile.
Parameters
- profile ConsoleMonster.Text.TerminalWidthProfile
Returns
TerminalProfileInherited Methods
Properties
public Color DefaultForeground { get; private set; } #The per-render foreground used when a style requests the terminal default. Defaults to Color.Default; the profile never reads or changes host colors itself.
public Color DefaultBackground { get; private set; } #The per-render background used when a style requests the terminal default. Defaults to Color.Default; color-disabled output ignores this baseline.
public bool SupportsVirtualTerminal { get; } #Whether VT escape sequences are understood.
public bool SupportsHyperlinks { get; } #Whether this output may emit OSC 8 hyperlinks. Requires interactive VT output and detected or explicitly enabled support; redirected output and CI always return false, including when support was overridden.
public ImageProtocol ImageProtocol { get; } #How this output may draw an inline image: the detected or configured protocol (TerminalProfile.WithImageProtocol) on interactive VT output with 256 colours or more, and half blocks on other line output with those colours. Redirected, CI, plain, no-colour and 16-colour output always get ImageProtocol.None, a text placeholder, so image sequences never reach logs or files.
public bool IsOutputRedirected { get; } #Whether standard output is redirected to a file, pipe or log.
public bool IsWidthKnown { get; } #Whether TerminalProfile.Width is the destination's real width: a terminal window, COLUMNS or a size the caller chose. It is false for redirected output without COLUMNS, where TerminalProfile.Width is only the layout default (TerminalProfile.DefaultWidth): line output (status lists, text, facts) is then not wrapped or cut at that width, while tables, panels and charts still lay out at it.
public bool IsConsoleHandle { get; } #Whether output goes to a real Windows console handle (UTF-16 through WriteConsoleW).
public bool IsContinuousIntegration { get; } #Whether a CI environment was detected.
public string? FontFace { get; } #The console font face, when known (conhost through GetCurrentConsoleFontEx).
public IReadOnlyList<string> Decisions { get; } #Human-readable notes explaining how each value was chosen (shown by Get-ConsoleCapability). The images: note describes the final TerminalProfile.ImageProtocol of this profile, including its output guards.
public TerminalWidthProfile WidthProfile { get; } #The configured or derived Unicode display width profile.
public bool ProbeWidths { get; } #Whether an interactive session may probe terminal widths.
public ThemeMode ThemeMode { get; } #The requested light or dark mode, or automatic detection from the terminal background.
public ThemePalette Palette { get; private set; } #The requested palette (standard, high contrast, colour-blind-safe or the terminal's own). Set with TerminalProfile.WithPalette.
public CultureInfo? Culture { get; } #The culture for numbers and dates in rendered output (thousand and decimal separators, date formats), or null to follow the current culture at render time, as PowerShell does. Set by CONSOLEMONSTER_CULTURE or TerminalProfile.WithCulture. Built-in labels follow TerminalProfile.Language.
public CultureInfo? Language { get; private set; } #The language of built-in labels (prompt keys, status words, "Showing 5 of 20"), or null for the current UI culture ($PSUICulture in PowerShell), unless CONSOLEMONSTER_LANGUAGE names one. English, Polish, German, Spanish, French and Italian are built in; other languages fall back to English. Set with TerminalProfile.WithLanguage.
public BoxStyle? Border { get; private set; } #The frame for panels, tables and inputs that use the default frame, chosen with CONSOLEMONSTER_BORDER or the Border setting; null uses the theme's (ThemeAppearance.Border). Set with TerminalProfile.WithBorder.
public StatusMarkerStyle? StatusMarkers { get; private set; } #How statuses are marked, chosen with CONSOLEMONSTER_STATUS_MARKERS or the StatusMarkers setting; null uses the theme's (ThemeAppearance.StatusMarkers). Set with TerminalProfile.WithStatusMarkers.
public ThemeDensity? Density { get; private set; } #Widget spacing chosen by CONSOLEMONSTER_DENSITY or the Density setting; null uses the theme.
public bool IsAccessible { get; private set; } #Whether accessible interaction and append-only live narration were requested.
public bool ReducedMotion { get; private set; } #Whether animation is disabled and live redraws are limited to once a second.
public bool IsLive { get; } #Whether this profile permits live cursor-based rendering.