GhosttyTerminalView class
Painter-based terminal widget that renders lines from GhosttyTerminalController.
The controller now keeps a real VtTerminal alive, and this widget sizes that VT grid to the available layout while rendering styled VT formatter snapshots with lightweight Flutter painting.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- GhosttyTerminalView
Constructors
-
GhosttyTerminalView({required GhosttyTerminalController controller, Key? key, bool autofocus = false, FocusNode? focusNode, Color backgroundColor = const Color(0xFF0A0F14), Color foregroundColor = const Color(0xFFE6EDF3), Color chromeColor = const Color(0xFF121A24), double fontSize = 14, double lineHeight = 1.35, String? fontFamily, List<
String> ? fontFamilyFallback, String? fontPackage, double letterSpacing = 0, double cellWidthScale = 1, GhosttyTerminalRendererMode renderer = GhosttyTerminalRendererMode.formatter, EdgeInsets padding = const EdgeInsets.all(12), GhosttyTerminalPalette palette = GhosttyTerminalPalette.xterm, Color cursorColor = const Color(0xFF9AD1C0), Color selectionColor = const Color(0x665DA9FF), Color hyperlinkColor = const Color(0xFF61AFEF), GhosttyTerminalCopyOptions copyOptions = const GhosttyTerminalCopyOptions(), GhosttyTerminalWordBoundaryPolicy wordBoundaryPolicy = const GhosttyTerminalWordBoundaryPolicy(), double selectionAutoScrollEdgeInset = 28, ValueChanged<GhosttyTerminalSelection?> ? onSelectionChanged, ValueChanged<GhosttyTerminalSelectionContent< ? onSelectionContentChanged, Future<GhosttyTerminalSelection> ?>void> onCopySelection(String text)?, Future<String?> onPasteRequest()?, Future<void> onOpenHyperlink(String uri)?}) -
const
Properties
- autofocus → bool
-
Whether the view should request focus automatically when inserted.
final
- backgroundColor → Color
-
Terminal background color used for unstyled cells.
final
- cellWidthScale → double
-
Horizontal cell scaling factor used when measuring character advances.
final
- chromeColor → Color
-
Accent color used for terminal chrome such as headers and borders.
final
- controller → GhosttyTerminalController
-
Session controller that owns the live VT terminal and process transport.
final
- copyOptions → GhosttyTerminalCopyOptions
-
Controls how selected cells are converted back into plain text.
final
- cursorColor → Color
-
Cursor fill or stroke color, depending on cursor style.
final
- focusNode → FocusNode?
-
Optional externally-managed focus node for keyboard input.
final
- fontFamily → String?
-
Preferred monospace font family for terminal text.
final
-
fontFamilyFallback
→ List<
String> ? -
Fallback font families used when fontFamily lacks required glyphs.
final
- fontPackage → String?
-
Optional package that provides fontFamily.
final
- fontSize → double
-
Base font size in logical pixels for each terminal cell.
final
- foregroundColor → Color
-
Default foreground color used for unstyled text.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hyperlinkColor → Color
-
Fallback color used when hyperlinks do not specify their own style.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- letterSpacing → double
-
Extra tracking applied to terminal glyph layout.
final
- lineHeight → double
-
Line height multiplier applied to terminal rows.
final
-
onCopySelection
→ Future<
void> Function(String text)? -
Override for copy behavior. When omitted the view writes to the clipboard directly.
final
-
onOpenHyperlink
→ Future<
void> Function(String uri)? -
Callback used when the user activates a hyperlink inside the terminal.
final
-
onPasteRequest
→ Future<
String?> Function()? -
Optional paste callback used instead of reading from the system clipboard.
final
-
onSelectionChanged
→ ValueChanged<
GhosttyTerminalSelection?> ? -
Called whenever the active terminal selection changes.
final
-
onSelectionContentChanged
→ ValueChanged<
GhosttyTerminalSelectionContent< ?GhosttyTerminalSelection> ?> -
Called whenever selection text is recomputed for the active selection.
final
- padding → EdgeInsets
-
Inner padding between the widget bounds and the terminal grid.
final
- palette → GhosttyTerminalPalette
-
ANSI and 256-color palette used to resolve terminal color tokens.
final
- renderer → GhosttyTerminalRendererMode
-
Paint backend used to render terminal cells.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectionAutoScrollEdgeInset → double
-
Distance from the viewport edge that triggers auto-scroll during drag selection.
final
- selectionColor → Color
-
Overlay color used for interactive text selection highlights.
final
- wordBoundaryPolicy → GhosttyTerminalWordBoundaryPolicy
-
Controls how double-click and word-based selections expand.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< GhosttyTerminalView> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited