Skip to content
ConsoleMonster
Class

ConsoleApp

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Modifiers
static

Runs reactive input widgets in an ordinary layout, with callbacks on the input thread and live cell diffing.

Inheritance

  • object
  • ConsoleApp

Methods

public static AppState Run(IWidget layout, AppState? state = null, ConsoleAppOptions? options = null, CancellationToken cancellationToken = default) #

Runs until Escape, input completion, cancellation or a requested exit, and returns the final state.

Parameters

layout ConsoleMonster.Layout.IWidget required
A layout containing named inputs and dependent display bindings.
state ConsoleMonster.Interactive.AppState? = null optional
Shared values, or null to create an empty state.
options ConsoleMonster.Interactive.ConsoleAppOptions? = null optional
Input and rendering configuration.
cancellationToken System.Threading.CancellationToken = default optional
Cancels input and restores the terminal before returning control.

Returns

AppState The final state, including every named input's committed value.

Exceptions

  • PromptUnavailableException – Interactive input is unavailable and a static snapshot was not requested.
  • OperationCanceledException – Cancellation was requested.
  • ArgumentException – Inline live mode was requested; interactive apps require a stable full-screen origin.
public static Task<AppState> RunAsync(IWidget layout, AppState? state = null, ConsoleAppOptions? options = null, CancellationToken cancellationToken = default) #

Runs the same input loop on a worker thread, preserving callback and input-lease thread affinity.

Parameters

layout ConsoleMonster.Layout.IWidget required
The layout.
state ConsoleMonster.Interactive.AppState? = null optional
Shared values, or null.
options ConsoleMonster.Interactive.ConsoleAppOptions? = null optional
Input and rendering options.
cancellationToken System.Threading.CancellationToken = default optional
Cancels the application.

Returns

Task<AppState> The final application state.