Table of Contents

Namespace Terminal.Gui.Configuration

Configuration management, themes, and persistent settings.

The Configuration namespace loads Terminal.Gui settings from JSON using Microsoft.Extensions.Configuration.

Key Types

  • TuiConfigurationBuilder - Builds the source chain and applies values to Settings POCOs
  • TuiConfigurationExtensions - AddTuiLibraryDefaults, AddTuiUserFiles, AddTuiRuntimeConfig
  • IThemeManager / MecThemeManager - Theme names and SwitchTheme
  • ISchemeManager / SchemeManager - Named schemes
  • ThemeChanges - Process-wide ThemeChanged observer
  • *Settings records (ButtonSettings, GlyphSettings, …) - Bind targets; theme-scoped types expose Current

Example

TuiConfigurationBuilder builder = new ("MyApp");
builder.RuntimeConfig = """{ "Theme": "Dark" }""";
builder.ApplyToStaticFacades ();

builder.ThemeManager.SwitchTheme ("Dark");

See Also

Classes

ApplicationSettings

Settings POCO for application-level configuration (SettingsScope). These correspond to the static properties on Application and related classes.

ButtonSettings

Immutable settings record for Button visual defaults (ThemeScope).

CharMapSettings

Immutable settings record for CharMap defaults (ThemeScope).

CheckBoxSettings

Immutable settings record for CheckBox visual defaults (ThemeScope).

DialogSettings

Immutable settings record for Dialog visual defaults (ThemeScope).

DriverSettings

Settings POCO for driver-level configuration (SettingsScope).

FileDialogSettings

Settings POCO for FileDialog defaults (SettingsScope).

FileDialogStyleSettings

Settings POCO for FileDialogStyle defaults (SettingsScope).

FrameViewSettings

Immutable settings record for FrameView defaults (ThemeScope).

GlyphSettings

Settings POCO for Glyphs defaults (ThemeScope).

HexViewSettings

Immutable settings record for HexView defaults (ThemeScope).

KeyArrayJsonConverter

Serializes and deserializes Key arrays as JSON string arrays (e.g. ["Ctrl+A", "Home"]). Each element uses ToString() for writing and TryParse(string, out Key) for reading.

KeyJsonConverter

Support for Key in JSON in the form of "Ctrl-X" or "Alt-Shift-F1".

KeySettings

Settings POCO for Key defaults (SettingsScope).

LinearRangeSettings

Immutable settings record for LinearRangeDefaults defaults (ThemeScope).

MecThemeManager

Per-builder IThemeManager. Process-wide callers use the static ThemeManager facade (ThemeManager.Theme =).

MenuBarSettings

Immutable settings record for MenuBar defaults.

MenuSettings

Immutable settings record for Menu defaults (ThemeScope).

MessageBoxSettings

Immutable settings record for MessageBox visual defaults (ThemeScope).

MouseFlagsArrayJsonConverter

Serializes and deserializes MouseFlags arrays as JSON string arrays (e.g. ["LeftButtonPressed+Shift", "LeftButtonReleased"]).

NerdFontsSettings

Immutable settings record for Terminal.Gui.Text.NerdFonts defaults (ThemeScope).

PopoverMenuSettings

Immutable settings record for PopoverMenu defaults (SettingsScope).

SchemeManager

Holds the Schemes that define the Attributes views use to render. A Scheme maps VisualRoles to Attributes.

SelectorBaseSettings

Immutable settings record for SelectorBase defaults (ThemeScope).

StatusBarSettings

Immutable settings record for StatusBar defaults (ThemeScope).

TextFieldSettings

Immutable settings record for TextField defaults (ThemeScope).

TextViewSettings

Immutable settings record for TextView defaults (ThemeScope).

ThemeChanges

Static facade that raises when the active theme has changed. Provided for consumers that cannot take an IThemeManager dependency (typically View subclasses).

ThemeManager

Static facade for the active theme. Backed by ThemeSettings and Shared.

ThemeSettings

Settings POCO for theme selection (SettingsScope). Controls which theme is active and what themes are available.

TraceSettings

Settings POCO for Trace defaults (SettingsScope).

TuiConfigurationBuilder

Builds and manages a Terminal.Gui MEC-based configuration, loading from all standard sources in the correct precedence order.

TuiConfigurationExtensions

Extension methods for IConfigurationBuilder that add Terminal.Gui configuration sources in the correct precedence order (matching MEC provider order).

TuiJsonErrors

Collects JSON load errors from MEC sources so they can be printed at shutdown instead of failing fast (the v2 contract).

WindowSettings

Immutable settings record for Window visual defaults (ThemeScope).

Interfaces

ISchemeManager

Abstracts color scheme management. Provides access to named schemes.

IThemeManager

Abstracts theme management. Allows switching themes and querying available themes.