跳到正文

Terminal

嵌入保留式 Ghostty 终端表面,并报告进程生命周期事件。

嵌入保留式 Ghostty 终端表面,并报告进程生命周期事件。

#导入

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"
)

#用法

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 参考

展开条目查看说明和完整签名。短横线表示声明中未记录默认值。

terminal.View

查看源码
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
查看源码
Childrenany—

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

any
查看源码
OnClickfunc(*native.Event)—

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

func(*native.Event)
查看源码
OnMouseEnterfunc(*native.Event)—

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

func(*native.Event)
查看源码
OnMouseLeavefunc(*native.Event)—

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

func(*native.Event)
查看源码
OnInputfunc(*native.Event)—

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

func(*native.Event)
查看源码
OnSubmitfunc(*native.Event)—

Called when the control submits its current value.

func(*native.Event)
查看源码
OnDismissfunc(*native.Event)—

Reports toast identifiers dismissed by the core.

func(*native.Event)
查看源码
OnPointerfunc(*native.Event)—

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

func(*native.Event)
查看源码
OnPresentationChangefunc(*native.Event)—

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

func(*native.Event)
查看源码
OnSelectfunc(*native.Event)—

Reports the menu entry selected by the core.

func(*native.Event)
查看源码
OnKeyDownfunc(*native.Event)—

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

func(*native.Event)
查看源码
OnKeyUpfunc(*native.Event)—

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

func(*native.Event)
查看源码
OnMouseDownfunc(*native.Event)—

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

func(*native.Event)
查看源码
OnMouseUpfunc(*native.Event)—

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

func(*native.Event)
查看源码
OnMouseMovefunc(*native.Event)—

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

func(*native.Event)
查看源码
OnDoubleClickfunc(*native.Event)—

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

func(*native.Event)
查看源码
OnWheelfunc(*native.Event)—

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

func(*native.Event)
查看源码
OnContextMenufunc(*native.Event)—

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

func(*native.Event)
查看源码
OnPinchfunc(*native.Event)—

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

func(*native.Event)
查看源码
OnRotatefunc(*native.Event)—

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

func(*native.Event)
查看源码
OnSmartMagnifyfunc(*native.Event)—

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

func(*native.Event)
查看源码
OnPressurefunc(*native.Event)—

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

func(*native.Event)
查看源码
OnFocusfunc(*native.Event)—

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

func(*native.Event)
查看源码
OnBlurfunc(*native.Event)—

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

func(*native.Event)
查看源码
OnActionfunc(*native.Event)—

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

func(*native.Event)
查看源码
OnDragStartfunc(*native.Event)—

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

func(*native.Event)
查看源码
OnDragEndfunc(*native.Event)—

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

func(*native.Event)
查看源码
OnDropfunc(*native.Event)—

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

func(*native.Event)
查看源码
OnFilesDroppedfunc(*native.Event)—

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

func(*native.Event)
查看源码
OnComponentChangefunc(*native.Event)—

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

func(*native.Event)
查看源码
OnCommitfunc(*native.Event)—

Reports one explicit commit boundary and its final value details.

func(*native.Event)
查看源码
Disabledany—

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

any
查看源码
Valueany—

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

any
查看源码
Placeholderstring—

Hint displayed while the text value is empty.

string
查看源码
Multilinebool—

Allows multiple lines in the core text editor.

bool
查看源码
AriaLabelany—

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

any
查看源码
Selectedany—

Exposes the selected state of this item.

any
查看源码
Groupany—

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

any
查看源码
FocusOnPointerany—

Whether a pointer press moves keyboard focus to the control.

any
查看源码
FocusableWhenDisabledany—

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

any
查看源码
HitSlopany—

Expands the pointer hit area without changing the visual bounds.

any
查看源码
HitSlopTopany—

Extra pointer hit area above the visual bounds.

any
查看源码
HitSlopRightany—

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

any
查看源码
HitSlopBottomany—

Extra pointer hit area below the visual bounds.

any
查看源码
HitSlopLeftany—

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

any
查看源码
Reffunc(*native.Node)—

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

func(*native.Node)
查看源码
Passwordany—

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

any
查看源码
EstimatedItemHeightany—

Initial logical row-height estimate used by virtualization.

any
查看源码
Overscanany—

Extra rows mounted before and after the visible range.

any
查看源码
OverscanPixelsany—

Extra logical distance mounted before and after the visible range.

any
查看源码
ItemHeightsany—

Exact row heights supplied without waiting for layout measurement.

any
查看源码
ListAlignmentstring—

Pins short list content to the top or bottom.

string
查看源码
FollowModestring—

Chooses ordinary scrolling or tail-following behavior.

string
查看源码
ObjectFitstring—

How image content fits its declared box.

string
查看源码
ShaderParametersany—

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

any
查看源码
Invalidany—

Projects invalid state to the field and its parts.

any
查看源码
Roleany—

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

any
查看源码
TabIndexany—

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

any
查看源码
Overlayany—

Places this content in the overlay paint plane.

any
查看源码
FocusTrapany—

Keeps keyboard focus within the active modal surface.

any
查看源码
RestorePreviousFocusany—

Restores the previously focused element when the surface closes.

any
查看源码
AutoFocusany—

Requests initial keyboard focus when the element mounts.

any
查看源码
AriaModalany—

Exposes the modal state of the surface to accessibility.

any
查看源码
DismissOnEscapeany—

Allows Escape to dismiss the surface.

any
查看源码
DismissOnPointerOutsideany—

Allows a pointer press outside the surface to dismiss it.

any
查看源码
TooltipTextany—

Text displayed by the element’s tooltip.

any
查看源码
TooltipPlacementany—

Preferred side and alignment of the tooltip.

any
查看源码
TooltipDelayany—

Delay before the tooltip opens.

any
查看源码
TooltipGapany—

Space between the tooltip and its trigger.

any
查看源码
TooltipViewportMarginany—

Minimum space between the tooltip and the window edges.

any
查看源码
AnchorTargetany—

Identity of the element used to position the surface.

any
查看源码
AnchorPlacementany—

Preferred side and alignment relative to the anchor.

any
查看源码
AnchorGapany—

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

any
查看源码
ViewportMarginany—

Minimum space reserved around the surface within the viewport.

any
查看源码
Keymapany—

Keyboard bindings used by the editor.

any
查看源码
Draggableany—

Enables the element as a drag source.

any
查看源码
DropKindsany—

Kinds of drop payload this target accepts.

any
查看源码
Programstring—

Executable launched by the terminal.

string
查看源码
Args[]string—

Arguments passed to the terminal process.

[]string
查看源码
WorkingDirectorystring—

Initial working directory for the terminal process.

string
查看源码
Scrollbackint—

Maximum retained scrollback lines.

int
查看源码
Environmentmap[string]string—

Environment entries added to the terminal process.

map[string]string
查看源码
Paletteany—

Palette or an accessor returning one.

any
查看源码
CursorColorany—

Cursor color or color accessor.

any
查看源码
PaddingColorstring—

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

string
查看源码
FontThickenbool—

Enables native font thickening.

bool
查看源码
OnStatusfunc(*native.Event)—

Reports terminal process lifecycle changes.

func(*native.Event)
查看源码