Documentation
¶
Overview ¶
Package terminal gives TSX nsgo/base's Terminal, base/terminal's View over a session of its own, which links libghostty-vt's binding: an app whose TSX uses it imports this package for its effect.
Index ¶
- type Ref
- func (r *Ref) ClearSelection()
- func (r *Ref) Copy()
- func (r *Ref) Dir() string
- func (r *Ref) Focus()
- func (r *Ref) FontSize() core.Points
- func (r *Ref) Paste()
- func (r *Ref) Perform(action terminal.Action, amount core.Points) bool
- func (r *Ref) SelectAll()
- func (r *Ref) Selected() bool
- func (r *Ref) Send(text string)
- func (r *Ref) SetCursor(c terminal.CursorStyle)
- func (r *Ref) SetFontSize(size core.Points)
- func (r *Ref) Title() string
- type Terminal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ref ¶
type Ref struct {
// contains filtered or unexported fields
}
Ref is a Terminal's ref: the view's selection and clipboard, and the session's cursor, title and directory.
func (*Ref) ClearSelection ¶
func (r *Ref) ClearSelection()
func (*Ref) SetCursor ¶
func (r *Ref) SetCursor(c terminal.CursorStyle)
SetCursor sets the cursor's shape until a program changes it.
func (*Ref) SetFontSize ¶
type Terminal ¶
type Terminal struct {
// The session, as terminal.Options.
Command []string
Dir string
Env []string
Conn io.ReadWriteCloser
Scrollback int
ImageLimit int64
Cursor terminal.CursorStyle
CursorBlink bool
// OnTitle, OnExit and OnBell run as the program sets the title, ends
// or rings the bell.
OnTitle func(title string)
OnExit func(code int)
OnBell func()
Unavailable func(message string) core.Node
// The view, as terminal.View: Theme and DarkTheme name Ghostty's
// themes, DarkTheme being Theme when unset.
Theme, DarkTheme func() string
FontFamily func() string
FontSize func() float64
PaddingX, PaddingY func() float64
AllowClipboardRead, AllowClipboardWrite func() bool
PaddingColor func() terminal.PaddingColor
MinimumContrast func() float64
AutoFocus bool
Transparent bool
MouseReporting func() bool
MouseScrollPrecision func() float64
MouseScrollDiscrete func() float64
Keybinds func() []terminal.Keybind
RightClickAction func() terminal.RightClickAction
MenuClass string
MenuStyle core.Style
MenuItemClass string
MenuItemStyle core.Style
NoKeyBar func() bool
KeyBarKeys []string
KeyBarClass string
KeyBarStyle core.Style
KeyClass string
KeyStyle core.Style
KeyOnClass string
KeyOnStyle core.Style
OnSizeChange func(cols, rows int)
OnFocus, OnBlur func()
Class, Label, TestID string
Style core.Style
Ref *Ref
}
Terminal is a terminal running a program, the user's shell by default, or connected to Conn. Its session's props start it, and a change of one starts another; the view's follow their props, the session going on.