Table of Contents

Class TuiConfigurationExtensions

Namespace
Terminal.Gui.Configuration
Assembly
Terminal.Gui.dll

Extension methods for IConfigurationBuilder that add Terminal.Gui configuration sources in the correct precedence order (matching the existing SourcesManager behavior).

public static class TuiConfigurationExtensions
Inheritance
TuiConfigurationExtensions
Inherited Members

Fields

CONFIG_FILENAME

The default config filename.

TUI_CONFIG_ENV

The name of the TUI configuration environment variable.

TUI_CONFIG_FOLDER

The name of the TUI configuration folder.

Methods

AddTuiAppDefaults(IConfigurationBuilder, string?)

Adds the entry assembly's embedded config.json as a configuration source.

AddTuiEnvironmentVariable(IConfigurationBuilder)

Adds the TUI_CONFIG environment variable as a JSON configuration source. The environment variable value is treated as inline JSON content.

AddTuiLibraryDefaults(IConfigurationBuilder)

Adds the Terminal.Gui library's embedded config.json as a configuration source. This is the lowest-priority file-based source (above hard-coded POCO defaults).

AddTuiRuntimeConfig(IConfigurationBuilder, string?)

Adds an in-memory JSON string as the highest-priority configuration source. Equivalent to the legacy ConfigurationManager.RuntimeConfig property.

AddTuiUserFiles(IConfigurationBuilder, string?)

Adds user-level configuration files from the standard locations:

  • ~/.tui/config.json (GlobalHome)
  • ./.tui/config.json (GlobalCurrent)
  • ~/.tui/{appName}.config.json (AppHome)
  • ./.tui/{appName}.config.json (AppCurrent)

Files are optional — missing files are silently skipped. Later files override earlier ones.