Skip to content

TerminalExtensions ​

Namespace: Hex1b

Assembly: Hex1b.dll

Extension methods for creating TerminalWidget.

csharp
public static class TerminalExtensions

Inheritance ​

Object → TerminalExtensions

Methods ​

Background(TerminalWidget, Hex1bColor) ​

Sets the background colour for the terminal's framing area and for cells the workload writes with the default background.

Parameters:

  • widget (TerminalWidget): The TerminalWidget to configure.
  • color (Hex1bColor): The background colour. Pass to restore the transparent (inherits-from-parent) behaviour.

Returns: TerminalWidget

The configured TerminalWidget.

csharp
public static TerminalWidget Background(this TerminalWidget widget, Hex1bColor color)

CopyModeBindings(TerminalWidget, Action<CopyModeBindingsOptions>?) ​

Enables standard copy mode bindings with configurable key and mouse mappings. Provides vi-style keyboard navigation, character/line/block selection, and mouse drag-to-select with modifier keys.

Parameters:

Returns: TerminalWidget

The configured TerminalWidget.

csharp
public static TerminalWidget CopyModeBindings(this TerminalWidget widget, Action<CopyModeBindingsOptions>? configure = null)

MouseWheelScrollAmount(TerminalWidget, int) ​

Sets the number of rows to scroll per mouse wheel tick.

Parameters:

  • widget (TerminalWidget): The TerminalWidget to configure.
  • rows (Int32): Number of rows per scroll tick. Defaults to 3.

Returns: TerminalWidget

The configured TerminalWidget.

csharp
public static TerminalWidget MouseWheelScrollAmount(this TerminalWidget widget, int rows)

Terminal<TParent>(WidgetContext<TParent>, TerminalWidgetHandle) ​

Creates a TerminalWidget that displays the content of the specified terminal handle.

Parameters:

  • context (WidgetContext<<TParent>>): The widget context.
  • handle (TerminalWidgetHandle): The terminal handle to display.

Returns: TerminalWidget

A new TerminalWidget bound to the handle.

csharp
public static TerminalWidget Terminal<TParent>(this WidgetContext<TParent> context, TerminalWidgetHandle handle) where TParent : Hex1bWidget

WhenNotRunning(TerminalWidget, Func<TerminalNotRunningArgs, Hex1bWidget>) ​

Specifies a fallback widget to display when the terminal is not running.

Parameters:

Returns: TerminalWidget

The configured TerminalWidget.

csharp
public static TerminalWidget WhenNotRunning(this TerminalWidget widget, Func<TerminalNotRunningArgs, Hex1bWidget> builder)

Released under the MIT License.