IHex1bTerminalWorkloadAdapter
Namespace: Hex1b
Assembly: Hex1b.dll
Terminal-side interface: What Hex1bTerminal needs from any workload. Raw byte streams for maximum flexibility.
public interface IHex1bTerminalWorkloadAdapter : IAsyncDisposableMethods
ReadOutputAsync(CancellationToken)
Read output FROM the workload (ANSI sequences to display). The terminal calls this to get data to parse and send to presentation. Returns empty when workload has no more output (should be called in a loop).
Parameters:
ct(CancellationToken):
Returns: ValueTask<Byte>>
ValueTask<ReadOnlyMemory<byte>> ReadOutputAsync(CancellationToken ct = default)ResizeAsync(int, int, CancellationToken)
Notify workload of terminal resize.
Parameters:
width(Int32):height(Int32):ct(CancellationToken):
Returns: ValueTask
ValueTask ResizeAsync(int width, int height, CancellationToken ct = default)WriteInputAsync(ReadOnlyMemory<byte>, CancellationToken)
Write input TO the workload (raw bytes from keyboard/mouse). The terminal calls this when it receives input from the presentation layer.
Parameters:
data(ReadOnlyMemory<Byte>):ct(CancellationToken):
Returns: ValueTask
ValueTask WriteInputAsync(ReadOnlyMemory<byte> data, CancellationToken ct = default)Events
Disconnected
Raised when workload has disconnected/exited.
Returns: Action
event Action? DisconnectedRemarks
This interface represents the "workload side" of the terminal - the process or application connected to the terminal. It deals with raw bytes only.
Data flow:
- Terminal reads output FROM the workload (ANSI to display) - Terminal writes input TO the workload (keystrokes, mouse)
Implementations:
- For Hex1bApp TUI applications - For testing with raw streams - For connecting to a remote terminal over WebSocketProcessWorkloadAdapter (future) - For PTY-connected processes