TerminalNode
Namespace: Hex1b.Nodes
Assembly: Hex1b.dll
Render node for displaying an embedded terminal session.
public sealed class TerminalNode : Hex1bNodeInheritance
Object → Hex1bNode → TerminalNode
Properties
Handle
Gets or sets the terminal handle this node renders from.
Returns: TerminalWidgetHandle
public TerminalWidgetHandle? Handle { get; set; }HasPendingOutput
Gets whether there is pending output that hasn't been rendered yet.
Returns: Boolean
public bool HasPendingOutput { get; }IsFocusable
Returns true if this node can receive focus.
Returns: Boolean
public override bool IsFocusable { get; }IsFocused
Gets or sets whether this node is currently focused. Only meaningful for focusable nodes (where IsFocusable is true).
Returns: Boolean
public override bool IsFocused { get; set; }IsInScrollbackMode
Gets whether the terminal is currently in scrollback mode (scrolled up from live view).
Returns: Boolean
public bool IsInScrollbackMode { get; }ManagesChildFocus
Returns true if this node manages focus for its children. When a parent manages focus, child containers should NOT set initial focus themselves. Container nodes like SplitterNode should override this to return true.
Returns: Boolean
public override bool ManagesChildFocus { get; }ScrollbackOffset
Gets the current scrollback offset (number of lines scrolled up from live view).
Returns: Int32
public int ScrollbackOffset { get; }SourceWidget
Gets or sets the source widget for this node.
Returns: TerminalWidget
public TerminalWidget? SourceWidget { get; set; }Methods
ArrangeCore(Rect)
Override this method to implement arranging logic for this node. The base implementation saves previous bounds, marks dirty on change, and sets bounds.
Parameters:
bounds(Rect):
protected override void ArrangeCore(Rect bounds)ConfigureDefaultBindings(InputBindingsBuilder)
Configures the default input bindings for this node type. Override in derived classes to add default key bindings. These bindings can be inspected and modified by the user's callback.
Parameters:
bindings(InputBindingsBuilder): The builder to add bindings to.
public override void ConfigureDefaultBindings(InputBindingsBuilder bindings)GetChildren()
Gets the direct children of this node for structural tree traversal. Container nodes should override this to return their children.
Returns: IEnumerable<Hex1bNode>
public override IEnumerable<Hex1bNode> GetChildren()GetFocusableNodes()
Gets all focusable nodes in this subtree (including this node if focusable).
Returns: IEnumerable<Hex1bNode>
public override IEnumerable<Hex1bNode> GetFocusableNodes()HandleInput(Hex1bEvent)
Handles an input event (after bindings have been checked). Override this in nodes to handle input that wasn't matched by any binding.
Parameters:
inputEvent(Hex1bEvent): The input event to handle (keyboard or mouse).
Returns: InputResult
Handled if the input was consumed, NotHandled otherwise.
public override InputResult HandleInput(Hex1bEvent inputEvent)HandleMouseClick(int, int, Hex1bMouseEvent)
Handles a mouse click event (after mouse bindings have been checked). Override this in nodes to handle clicks that weren't matched by any mouse binding. The coordinates in the event are local to this node's bounds (0,0 is top-left of node).
Parameters:
localX(Int32): The X coordinate relative to this node's bounds.localY(Int32): The Y coordinate relative to this node's bounds.mouseEvent(Hex1bMouseEvent): The original mouse event (with absolute coordinates).
Returns: InputResult
Handled if the click was consumed, NotHandled otherwise.
public override InputResult HandleMouseClick(int localX, int localY, Hex1bMouseEvent mouseEvent)MeasureCore(Constraints)
Override this method to implement measuring logic for this node.
Parameters:
constraints(Constraints):
Returns: Size
protected override Size MeasureCore(Constraints constraints)Render(Hex1bRenderContext)
Renders the node to the given context.
Parameters:
context(Hex1bRenderContext):
public override void Render(Hex1bRenderContext context)Remarks
The TerminalNode renders the screen buffer from a . It subscribes to the handle's OutputReceived event to trigger re-renders when new output arrives.
The node is focusable and forwards all keyboard input to the child terminal. Mouse clicks within the terminal's bounds will focus the terminal.
When the terminal has a scrollback buffer configured, the user can scroll up through previous output using keyboard shortcuts or mouse wheel. Scrollback viewing is disabled when the child process is using the alternate screen buffer (mode 1049), and mouse scroll events are forwarded to the child when it has enabled mouse tracking.