Skip to content
ConsoleMonster

API Reference

Class

InteractiveOptions

Namespace ConsoleMonster.Interactive
Assembly ConsoleMonster
Modifiers sealed

Settings shared by prompts, menus and forms: how to interact (detected by default), where input comes from, the terminal profile, theme and labels. Every property is optional.

Inheritance

  • Object
  • InteractiveOptions

Usage

Explore 49 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.

Accepted by parameters 41

Constructors

public InteractiveOptions() #

Methods

public InteractiveOptions Clone() #
Returns: InteractiveOptions

Returns a copy.

Returns

The copy.

public InteractionMode ResolveMode() #
Returns: InteractionMode

Picks the interaction mode: an explicit InteractiveOptions.Mode wins; then non-interactive sessions (the InteractiveOptions.NonInteractive flag, CONSOLEMONSTER_NONINTERACTIVE=1, CI, redirected input without an input source) get InteractionMode.None; CONSOLEMONSTER_ACCESSIBLE=1 gets InteractionMode.Accessible; consoles without VT get InteractionMode.Line; everything else InteractionMode.Rich.

Returns

The mode.

Properties

public static InteractiveOptions Default { get; set; } #

Process-wide defaults used when a prompt gets no options.

public InteractionMode? Mode { get; set; } #

Forces an interaction mode; null detects it (see InteractiveOptions.ResolveMode).

public Boolean NonInteractive { get; set; } #

Treats the session as non-interactive (PowerShell's -NonInteractive): prompts use defaults or fail.

public IInputSource? Input { get; set; } #

An input source instead of the console (a script in tests and demos).

public TerminalProfile? Profile { get; set; } #

The terminal profile; null uses Terminal.GetCurrentProfile.

public ITheme? Theme { get; set; } #

The theme; null uses Terminal.Theme.

public PromptLabels? Labels { get; set; } #

The built-in words; null uses PromptLabels.Default.

public ILineConsole? LineConsole { get; set; } #

Line input and output for the line-based and accessible modes; null uses the console.

public Int32? MaxInlineHeight { get; set; } #

The most rows an inline prompt may take (default: the window height minus two, at most 20).

public ScreenCapture? Capture { get; set; } #

Where prompts draw in InteractionMode.Rich mode (tests use a recording surface). Null picks the right one: inline below the cursor, or an overlay over a running live dashboard.

public ITerminalTarget? Target { get; set; } #

Where the prompt runs (see ITerminalTarget), or null for Terminal.Target. A target other than the console supplies the input (null input: nobody can answer, so defaults apply), the profile, and for a RecordingTarget the screen capture. InteractiveOptions.Input, InteractiveOptions.Profile and InteractiveOptions.Capture still win when set.