Skip to content

IHex1bAppTerminalWorkloadAdapter ​

Namespace: Hex1b

Assembly: Hex1b.dll

App-side interface: Adds the higher-level APIs that Hex1bApp needs. Extends the terminal-side interface so the same adapter serves both.

csharp
public interface IHex1bAppTerminalWorkloadAdapter : IHex1bTerminalWorkloadAdapter, IAsyncDisposable

Properties ​

Capabilities ​

Terminal capabilities (mouse, sixel, colors, etc.).

Returns: TerminalCapabilities

csharp
TerminalCapabilities Capabilities { get; }

Height ​

Current terminal height.

Returns: Int32

csharp
int Height { get; }

InputEvents ​

Channel of input events from the terminal.

Returns: ChannelReader<Hex1bEvent>

csharp
ChannelReader<Hex1bEvent> InputEvents { get; }

OutputQueueDepth ​

Gets the number of output items waiting to be consumed by the terminal. Can be used to detect back pressure and adjust input processing accordingly.

Returns: Int32

csharp
int OutputQueueDepth { get; }

Width ​

Current terminal width.

Returns: Int32

csharp
int Width { get; }

Methods ​

Clear() ​

Clear the screen.

csharp
void Clear()

EnterTuiMode() ​

Enter TUI mode (alternate screen, hide cursor, enable mouse if supported, etc.).

csharp
void EnterTuiMode()

ExitTuiMode() ​

Exit TUI mode (show cursor, disable mouse, exit alternate screen, etc.).

csharp
void ExitTuiMode()

Flush() ​

Flush any buffered output.

csharp
void Flush()

SetCursorPosition(int, int) ​

Set the cursor position.

Parameters:

csharp
void SetCursorPosition(int left, int top)

Write(ReadOnlyMemory<byte>) ​

Write raw bytes to the terminal without forcing a copy.

Parameters:

csharp
void Write(ReadOnlyMemory<byte> data)

Write(ReadOnlySpan<byte>) ​

Write raw bytes to the terminal.

Parameters:

csharp
void Write(ReadOnlySpan<byte> data)

Write(string) ​

Write ANSI-encoded output to the terminal.

Parameters:

csharp
void Write(string text)

Remarks ​

This interface represents the "app side" of the workload adapter. It provides the convenient APIs that Hex1bApp and its components use: Write(), InputEvents, Width/Height, etc.

The inheritance from ensures that any implementation can also be consumed by the future Hex1bTerminal.

Released under the MIT License.