Hex1bTerminalOptions
Namespace: Hex1b
Assembly: Hex1b.dll
Options for configuring a .
public sealed class Hex1bTerminalOptionsInheritance
Object → Hex1bTerminalOptions
Properties
EscapeSequenceTimeout
How long to wait for additional bytes after a bare ESC (0x1B) before treating it as a standalone Escape key press. Traditional terminals use ESC as both the Escape key and the first byte of multi-byte ANSI sequences; this timeout disambiguates the two cases.
Returns: Nullable<TimeSpan>
public TimeSpan? EscapeSequenceTimeout { get; set; }Height
Terminal height in rows. Used when no presentation adapter is provided. Default is 24.
Returns: Int32
public int Height { get; set; }Metrics
Metrics instance for OpenTelemetry instrumentation. If null, is used.
Returns: Hex1bMetrics
public Hex1bMetrics? Metrics { get; set; }PresentationAdapter
The presentation adapter for actual I/O (console, WebSocket, etc.). Pass null for headless/test mode.
Returns: IHex1bTerminalPresentationAdapter
public IHex1bTerminalPresentationAdapter? PresentationAdapter { get; set; }PresentationFilters
Filters applied on the presentation side of the terminal. These see output going to the presentation layer and input from the user.
Returns: IList<IHex1bTerminalPresentationFilter>
public IList<IHex1bTerminalPresentationFilter> PresentationFilters { get; }RunCallback
Optional callback that runs the workload and returns an exit code.
Returns: Func<CancellationToken, Int32>>
public Func<CancellationToken, Task<int>>? RunCallback { get; set; }ScrollbackCallback
Optional callback invoked each time a row is scrolled off the top of the terminal into the scrollback buffer. Can be used for persistence or logging.
Returns: Action<ScrollbackRowEventArgs>
public Action<ScrollbackRowEventArgs>? ScrollbackCallback { get; set; }ScrollbackCapacity
Maximum number of scrollback lines to retain. When null, no scrollback buffer is created (zero overhead). Default is null.
Returns: Nullable<Int32>
public int? ScrollbackCapacity { get; set; }TimeProvider
The time provider to use for all time-related operations. Defaults to if not specified.
Returns: TimeProvider
public TimeProvider TimeProvider { get; set; }Width
Terminal width in columns. Used when no presentation adapter is provided. Default is 80.
Returns: Int32
public int Width { get; set; }WorkloadAdapter
The workload adapter that connects to the application generating output. Required.
Returns: IHex1bTerminalWorkloadAdapter
public IHex1bTerminalWorkloadAdapter? WorkloadAdapter { get; set; }WorkloadFilters
Filters applied on the workload side of the terminal. These see raw output from the workload and input going to the workload.
Returns: IList<IHex1bTerminalWorkloadFilter>
public IList<IHex1bTerminalWorkloadFilter> WorkloadFilters { get; }Remarks
This class provides a structured way to configure all aspects of a terminal, including dimensions, adapters, and filters for both workload and presentation sides.
var options = new Hex1bTerminalOptions
{
Width = 80,
Height = 24,
WorkloadAdapter = new Hex1bAppWorkloadAdapter(),
PresentationAdapter = new ConsolePresentationAdapter()
};
options.WorkloadFilters.Add(new AsciinemaRecorder());
var terminal = new Hex1bTerminal(options);