Table of Contents

Class CommandLineOverlay

Namespace
MiniTui
Assembly
MiniTui.dll

A : command line for a CommandRegistry, shown at the bottom of the screen. Enter runs the command and shows its message as a toast; Esc closes. Not bound by default: app.Keys.Add(":", "Command", () => app.Overlays.Show(new CommandLineOverlay(registry))).

public sealed class CommandLineOverlay : Overlay
Inheritance
CommandLineOverlay
Inherited Members

Constructors

CommandLineOverlay(CommandRegistry)

Create a command line that runs commands from registry.

public CommandLineOverlay(CommandRegistry registry)

Parameters

registry CommandRegistry

Properties

CapturesText

True for text inputs: while this component is the innermost focused one, its ancestors' and the app's single-character bindings (without Ctrl or Alt) are skipped, so typing q doesn't quit.

public override bool CapturesText { get; }

Property Value

bool

Title

The title in the overlay's border.

public override string? Title { get; }

Property Value

string

Methods

HandleKey(ConsoleKeyInfo)

Handle a key before Keys. Return true if handled.

public override bool HandleKey(ConsoleKeyInfo key)

Parameters

key ConsoleKeyInfo

Returns

bool

HandlePaste(string)

Handle pasted text, such as with Paste(string). Return true if handled; otherwise the paste goes on to the component's parent, and is dropped if nothing handles it.

public override bool HandlePaste(string text)

Parameters

text string

Returns

bool

Placement(Rect)

Where the overlay goes, including its border. The default is centered, 60% × 50% of the screen, at least 30 × 7, and clamped to the screen minus a 2-cell margin.

public override Rect Placement(Rect screen)

Parameters

screen Rect

Returns

Rect

Render(Buffer, Rect, RenderContext)

Draw the component. Called every frame its parent renders it.

public override void Render(Buffer buf, Rect area, RenderContext ctx)

Parameters

buf Buffer
area Rect
ctx RenderContext