Table of Contents

Interface IApplicationMainLoop<TInputRecord>

Namespace
Terminal.Gui.App
Assembly
Terminal.Gui.dll

Interface for the main application loop that runs the core Terminal.Gui UI rendering and event processing.

public interface IApplicationMainLoop<TInputRecord> : IDisposable where TInputRecord : struct

Type Parameters

TInputRecord

Type of raw input events processed by the loop, e.g. ConsoleKeyInfo for cross-platform .NET driver

Inherited Members

Remarks

This interface defines the contract for the main loop that coordinates:

  • Processing input events from the console
  • Running user timeout callbacks
  • Detecting UI changes that need redrawing
  • Rendering UI updates to the console

Properties

AnsiRequestScheduler

Gets the class responsible for sending ANSI escape requests which expect a response from the remote terminal e.g. Device Attribute Request

App

The Application this loop is associated with.

InputProcessor

Gets InputProcessor implementation that processes the mouse and keyboard input populated by IInput<TInputRecord> implementations on the input thread and translating to events on the UI thread.

Output

Gets the IOutput implementation responsible for rendering the OutputBuffer to the console using platform specific methods.

OutputBuffer

Gets the IOutputBuffer representing the desired screen state for console rendering.

SizeMonitor

Gets the ISizeMonitor implementation that tracks terminal size changes.

TimedEvents

Gets the ITimedEvents implementation that manages user-defined timeouts and periodic events.

Methods

Initialize(ITimedEvents, ConcurrentQueue<TInputRecord>, IInputProcessor, IOutput, IComponentFactory<TInputRecord>, IApplication?)

Initializes the main loop with its required dependencies.

Iteration()

Perform a single iteration of the main loop then blocks for a fixed length of time, this method is designed to be run in a loop.