Skip to content
ConsoleMonster
Class

PromptEngine

ConsoleMonster.Prompts

Namespace
ConsoleMonster.Prompts
Assembly
ConsoleMonster
Implements
IDisposable
Modifiers
sealed

Evaluates prompt providers and owns the asynchronous cache for one shell session.

Inheritance

  • object
  • PromptEngine

Usage

Explore 3 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 1

Accepted by parameters 2

Constructors

public PromptEngine(IEnumerable<IPromptSegment>? segments = null) #

Uses the built-in segment catalogue, or a caller-owned provider catalogue.

Parameters

segments System.Collections.Generic.IEnumerable<ConsoleMonster.Prompts.IPromptSegment>? = null optional

Methods

public void Dispose() #

Cancels pending probes and releases this session's cache.

public void Refresh(PromptContext context, PromptConfiguration configuration) #

Evaluates the configured segments and queues any asynchronous refreshes that are due.

Parameters

context ConsoleMonster.Prompts.PromptContext required
The current shell and terminal snapshot.
configuration ConsoleMonster.Prompts.PromptConfiguration required
The segment lists and options for this prompt.

Properties

public static IReadOnlyList<string> SegmentNames { get; } #

The names that the built-in catalogue recognizes.

public IReadOnlyList<PromptSegmentReading> Readings { get; } #

The last reading for each built-in or custom provider that was used.

Events

public event Action<string>? Changed #

Notifies the host when a background result changes. A subscriber must marshal editor access.