Skip to content

Terminal

Embeds the retained Ghostty terminal surface and reports process lifecycle events.

#Import

go get github.com/egoist/quickgui/extensions/terminal
import (
	"github.com/egoist/quickgui/go/native"
	"github.com/egoist/quickgui/extensions/terminal"
	"github.com/egoist/quickgui/go/ui"
)

#Usage

func TerminalExample(directory string) *native.Node {
	return terminal.View(terminal.Props{
		Program:          "/bin/zsh",
		Args:             []string{"-l"},
		WorkingDirectory: directory,
		Props:            ui.Props{Style: ui.Style().Width("100%").Height(320)},
	})
}

#API reference

Expand an entry for its description and complete signature. A dash means no declaration default is documented.

terminal.View

View source
terminal.View(props Props, children ...any) *native.Node
StyleStyleBuilder—

Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.

StyleBuilder
View source
Childrenany—

Content mounted inside the component. Compound child callbacks run after the parent context exists.

any
View source
OnClickfunc(*native.Event)—

Called after QuickGUI resolves an activation, including supported keyboard activation.

func(*native.Event)
View source
OnMouseEnterfunc(*native.Event)—

Callback for mouse enter. The signature below lists the event payload.

func(*native.Event)
View source
OnMouseLeavefunc(*native.Event)—

Callback for mouse leave. The signature below lists the event payload.

func(*native.Event)
View source
OnInputfunc(*native.Event)—

Receives edits from the text control. Write the new text into the controlled value.

func(*native.Event)
View source
OnSubmitfunc(*native.Event)—

Called when the control submits its current value.

func(*native.Event)
View source
OnDismissfunc(*native.Event)—

Reports toast identifiers dismissed by the core.

func(*native.Event)
View source
OnPointerfunc(*native.Event)—

Callback for pointer. The signature below lists the event payload.

func(*native.Event)
View source
OnPresentationChangefunc(*native.Event)—

Callback for presentation change. The signature below lists the event payload.

func(*native.Event)
View source
OnSelectfunc(*native.Event)—

Reports the menu entry selected by the core.

func(*native.Event)
View source
OnKeyDownfunc(*native.Event)—

Callback for key down. The signature below lists the event payload.

func(*native.Event)
View source
OnKeyUpfunc(*native.Event)—

Callback for key up. The signature below lists the event payload.

func(*native.Event)
View source
OnMouseDownfunc(*native.Event)—

Callback for mouse down. The signature below lists the event payload.

func(*native.Event)
View source
OnMouseUpfunc(*native.Event)—

Callback for mouse up. The signature below lists the event payload.

func(*native.Event)
View source
OnMouseMovefunc(*native.Event)—

Callback for mouse move. The signature below lists the event payload.

func(*native.Event)
View source
OnDoubleClickfunc(*native.Event)—

Callback for double click. The signature below lists the event payload.

func(*native.Event)
View source
OnWheelfunc(*native.Event)—

Callback for wheel. The signature below lists the event payload.

func(*native.Event)
View source
OnContextMenufunc(*native.Event)—

Callback for context menu. The signature below lists the event payload.

func(*native.Event)
View source
OnPinchfunc(*native.Event)—

Callback for pinch. The signature below lists the event payload.

func(*native.Event)
View source
OnRotatefunc(*native.Event)—

Callback for rotate. The signature below lists the event payload.

func(*native.Event)
View source
OnSmartMagnifyfunc(*native.Event)—

Callback for smart magnify. The signature below lists the event payload.

func(*native.Event)
View source
OnPressurefunc(*native.Event)—

Callback for pressure. The signature below lists the event payload.

func(*native.Event)
View source
OnFocusfunc(*native.Event)—

Callback for focus. The signature below lists the event payload.

func(*native.Event)
View source
OnBlurfunc(*native.Event)—

Callback for blur. The signature below lists the event payload.

func(*native.Event)
View source
OnActionfunc(*native.Event)—

Callback for action. The signature below lists the event payload.

func(*native.Event)
View source
OnDragStartfunc(*native.Event)—

Callback for drag start. The signature below lists the event payload.

func(*native.Event)
View source
OnDragEndfunc(*native.Event)—

Callback for drag end. The signature below lists the event payload.

func(*native.Event)
View source
OnDropfunc(*native.Event)—

Callback for drop. The signature below lists the event payload.

func(*native.Event)
View source
OnFilesDroppedfunc(*native.Event)—

Callback for files dropped. The signature below lists the event payload.

func(*native.Event)
View source
OnComponentChangefunc(*native.Event)—

Receives the component change payload, including values for coordinated controls.

func(*native.Event)
View source
OnCommitfunc(*native.Event)—

Reports one explicit commit boundary and its final value details.

func(*native.Event)
View source
Disabledany—

Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.

any
View source
Valueany—

The current controlled value. Update application state from the change callback to accept a new value.

any
View source
Placeholderstring—

Hint displayed while the text value is empty.

string
View source
Multilinebool—

Allows multiple lines in the core text editor.

bool
View source
AriaLabelany—

Accessible name, especially for icon-only controls or controls without a visible label.

any
View source
Selectedany—

Exposes the selected state of this item.

any
View source
Groupany—

Names this element as a group for descendant interaction-state styling.

any
View source
FocusOnPointerany—

Whether a pointer press moves keyboard focus to the control.

any
View source
FocusableWhenDisabledany—

Allows a disabled button to remain keyboard focusable while activation stays disabled.

any
View source
HitSlopany—

Expands the pointer hit area without changing the visual bounds.

any
View source
HitSlopTopany—

Extra pointer hit area above the visual bounds.

any
View source
HitSlopRightany—

Extra pointer hit area to the right of the visual bounds.

any
View source
HitSlopBottomany—

Extra pointer hit area below the visual bounds.

any
View source
HitSlopLeftany—

Extra pointer hit area to the left of the visual bounds.

any
View source
Reffunc(*native.Node)—

Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.

func(*native.Node)
View source
Passwordany—

Conceals the entered text while preserving the editor’s value.

any
View source
EstimatedItemHeightany—

Initial logical row-height estimate used by virtualization.

any
View source
Overscanany—

Extra rows mounted before and after the visible range.

any
View source
OverscanPixelsany—

Extra logical distance mounted before and after the visible range.

any
View source
ItemHeightsany—

Exact row heights supplied without waiting for layout measurement.

any
View source
ListAlignmentstring—

Pins short list content to the top or bottom.

string
View source
FollowModestring—

Chooses ordinary scrolling or tail-following behavior.

string
View source
ObjectFitstring—

How image content fits its declared box.

string
View source
ShaderParametersany—

Up to sixteen numeric values packed into fixed shader parameter vectors.

any
View source
Invalidany—

Projects invalid state to the field and its parts.

any
View source
Roleany—

Accessibility role override. Prefer the component’s built-in semantics.

any
View source
TabIndexany—

Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.

any
View source
Overlayany—

Places this content in the overlay paint plane.

any
View source
FocusTrapany—

Keeps keyboard focus within the active modal surface.

any
View source
RestorePreviousFocusany—

Restores the previously focused element when the surface closes.

any
View source
AutoFocusany—

Requests initial keyboard focus when the element mounts.

any
View source
AriaModalany—

Exposes the modal state of the surface to accessibility.

any
View source
DismissOnEscapeany—

Allows Escape to dismiss the surface.

any
View source
DismissOnPointerOutsideany—

Allows a pointer press outside the surface to dismiss it.

any
View source
TooltipTextany—

Text displayed by the element’s tooltip.

any
View source
TooltipPlacementany—

Preferred side and alignment of the tooltip.

any
View source
TooltipDelayany—

Delay before the tooltip opens.

any
View source
TooltipGapany—

Space between the tooltip and its trigger.

any
View source
TooltipViewportMarginany—

Minimum space between the tooltip and the window edges.

any
View source
AnchorTargetany—

Identity of the element used to position the surface.

any
View source
AnchorPlacementany—

Preferred side and alignment relative to the anchor.

any
View source
AnchorGapany—

Space between the anchor and its surface, in logical pixels.

any
View source
ViewportMarginany—

Minimum space reserved around the surface within the viewport.

any
View source
Keymapany—

Keyboard bindings used by the editor.

any
View source
Draggableany—

Enables the element as a drag source.

any
View source
DropKindsany—

Kinds of drop payload this target accepts.

any
View source
Programstring—

Executable launched by the terminal.

string
View source
Args[]string—

Arguments passed to the terminal process.

[]string
View source
WorkingDirectorystring—

Initial working directory for the terminal process.

string
View source
Scrollbackint—

Maximum retained scrollback lines.

int
View source
Environmentmap[string]string—

Environment entries added to the terminal process.

map[string]string
View source
Paletteany—

Palette or an accessor returning one.

any
View source
CursorColorany—

Cursor color or color accessor.

any
View source
PaddingColorstring—

Use `"extend"` to paint padding with terminal edge backgrounds.

string
View source
FontThickenbool—

Enables native font thickening.

bool
View source
OnStatusfunc(*native.Event)—

Reports terminal process lifecycle changes.

func(*native.Event)
View source