TerminalWidget
Namespace: Hex1b.Widgets
Assembly: Hex1b.dll
A widget that displays an embedded terminal session.
public sealed record TerminalWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<TerminalWidget>Inheritance
Object → Hex1bWidget → TerminalWidget
Implements
Constructors
TerminalWidget(TerminalWidgetHandle)
A widget that displays an embedded terminal session.
Parameters:
Handle(TerminalWidgetHandle):
public TerminalWidget(TerminalWidgetHandle Handle)Properties
Handle
Returns: TerminalWidgetHandle
public TerminalWidgetHandle Handle { get; init; }MouseWheelScrollAmount
Gets the number of rows to scroll per mouse wheel tick. Defaults to 3.
Returns: Int32
public int MouseWheelScrollAmount { get; init; }Fields
CopyModeBufferBottom
Rebindable action: Move the copy mode cursor to the bottom of the buffer.
Returns: ActionId
public static readonly ActionId CopyModeBufferBottomCopyModeBufferTop
Rebindable action: Move the copy mode cursor to the top of the buffer.
Returns: ActionId
public static readonly ActionId CopyModeBufferTopCopyModeCancel
Rebindable action: Cancel copy mode without copying.
Returns: ActionId
public static readonly ActionId CopyModeCancelCopyModeCopy
Rebindable action: Copy the selected text and exit copy mode.
Returns: ActionId
public static readonly ActionId CopyModeCopyCopyModeDown
Rebindable action: Move the copy mode cursor down one row.
Returns: ActionId
public static readonly ActionId CopyModeDownCopyModeLeft
Rebindable action: Move the copy mode cursor left one column.
Returns: ActionId
public static readonly ActionId CopyModeLeftCopyModeLineEnd
Rebindable action: Move the copy mode cursor to the end of the current line.
Returns: ActionId
public static readonly ActionId CopyModeLineEndCopyModeLineStart
Rebindable action: Move the copy mode cursor to the start of the current line.
Returns: ActionId
public static readonly ActionId CopyModeLineStartCopyModePageDown
Rebindable action: Move the copy mode cursor down one page.
Returns: ActionId
public static readonly ActionId CopyModePageDownCopyModePageUp
Rebindable action: Move the copy mode cursor up one page.
Returns: ActionId
public static readonly ActionId CopyModePageUpCopyModeRight
Rebindable action: Move the copy mode cursor right one column.
Returns: ActionId
public static readonly ActionId CopyModeRightCopyModeStartSelection
Rebindable action: Start or toggle character selection in copy mode.
Returns: ActionId
public static readonly ActionId CopyModeStartSelectionCopyModeToggleBlockMode
Rebindable action: Toggle block/rectangular selection mode in copy mode.
Returns: ActionId
public static readonly ActionId CopyModeToggleBlockModeCopyModeToggleLineMode
Rebindable action: Toggle line selection mode in copy mode.
Returns: ActionId
public static readonly ActionId CopyModeToggleLineModeCopyModeUp
Rebindable action: Move the copy mode cursor up one row.
Returns: ActionId
public static readonly ActionId CopyModeUpCopyModeWordBackward
Rebindable action: Move the copy mode cursor backward one word.
Returns: ActionId
public static readonly ActionId CopyModeWordBackwardCopyModeWordForward
Rebindable action: Move the copy mode cursor forward one word.
Returns: ActionId
public static readonly ActionId CopyModeWordForwardEnterCopyMode
Rebindable action: Enter copy mode for text selection.
Returns: ActionId
public static readonly ActionId EnterCopyModeScrollDownLine
Rebindable action: Scroll down one line in the scrollback buffer.
Returns: ActionId
public static readonly ActionId ScrollDownLineScrollDownPage
Rebindable action: Scroll down one page in the scrollback buffer.
Returns: ActionId
public static readonly ActionId ScrollDownPageScrollToBottom
Rebindable action: Scroll to the bottom, returning to the live terminal view.
Returns: ActionId
public static readonly ActionId ScrollToBottomScrollToTop
Rebindable action: Scroll to the top of the scrollback buffer.
Returns: ActionId
public static readonly ActionId ScrollToTopScrollUpLine
Rebindable action: Scroll up one line in the scrollback buffer.
Returns: ActionId
public static readonly ActionId ScrollUpLineScrollUpPage
Rebindable action: Scroll up one page in the scrollback buffer.
Returns: ActionId
public static readonly ActionId ScrollUpPageRemarks
The TerminalWidget binds to a which provides the screen buffer from a running terminal session. This allows embedding child terminals within a TUI application.
When the terminal is not running (not started or completed), you can optionally provide a fallback widget using . This enables post-exit interactivity such as showing the exit code or a "restart" button.
Example usage:
var terminal = Hex1bTerminal.CreateBuilder()
.WithPtyProcess("bash")
.WithTerminalWidget(out var bashHandle)
.Build();
_ = terminal.RunAsync(appCt);
ctx.Terminal(bashHandle)
.WhenNotRunning(args => ctx.Text($"Exited with code {args.ExitCode}"));