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 ¶
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.
type Terminal ¶
type Terminal struct {
// The session, as terminal.Options.
Command []string
Dir string
Env []string
Conn io.ReadWriteCloser
Scrollback int
Cursor terminal.CursorStyle
// 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()
// why.
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
AutoFocus bool
Transparent bool
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.