libghostty

package
v0.0.0-...-1f0cc76 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DumpFormat

type DumpFormat uint32
const (
	DumpPlain          DumpFormat = 0    // Plain text, no escape sequences.
	DumpVTFull         DumpFormat = 1    // Full VT with all extras (for reattach).
	DumpVTSafe         DumpFormat = 2    // Safe VT — colors but no palette/mode corruption.
	DumpHTML           DumpFormat = 3    // HTML with inline CSS colors.
	DumpFlagUnwrap     DumpFormat = 0x10 // Bit 4: join soft-wrapped lines.
	DumpFlagScrollback DumpFormat = 0x20 // Bit 5: include scrollback history.
	DumpFormatMask     DumpFormat = 0x0F // Bits 0-3: format selector.
)

type KeyCode

type KeyCode uint32
const (
	KeyEnter     KeyCode = 0x100
	KeyEscape    KeyCode = 0x101
	KeyTab       KeyCode = 0x102
	KeyBackspace KeyCode = 0x103
	KeyUp        KeyCode = 0x110
	KeyDown      KeyCode = 0x111
	KeyLeft      KeyCode = 0x112
	KeyRight     KeyCode = 0x113
	KeyHome      KeyCode = 0x120
	KeyEnd       KeyCode = 0x121
	KeyPageUp    KeyCode = 0x122
	KeyPageDown  KeyCode = 0x123
	KeyInsert    KeyCode = 0x124
	KeyDelete    KeyCode = 0x125
	KeyF1        KeyCode = 0x130
	KeyF2        KeyCode = 0x131
	KeyF3        KeyCode = 0x132
	KeyF4        KeyCode = 0x133
	KeyF5        KeyCode = 0x134
	KeyF6        KeyCode = 0x135
	KeyF7        KeyCode = 0x136
	KeyF8        KeyCode = 0x137
	KeyF9        KeyCode = 0x138
	KeyF10       KeyCode = 0x139
	KeyF11       KeyCode = 0x13A
	KeyF12       KeyCode = 0x13B
)

type Modifier

type Modifier uint32
const (
	ModShift Modifier = 0x01
	ModCtrl  Modifier = 0x02
	ModAlt   Modifier = 0x04
	ModSuper Modifier = 0x08
)

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

func NewRuntime

func NewRuntime(ctx context.Context) (*Runtime, error)

func (*Runtime) Close

func (r *Runtime) Close() error

func (*Runtime) NewTerminal

func (r *Runtime) NewTerminal(ctx context.Context, cols, rows, scrollback uint32) (*Terminal, error)

type ScreenDump

type ScreenDump struct {
	VT          []byte
	CursorRow   uint32
	CursorCol   uint32
	IsAltScreen bool
}

type Terminal

type Terminal struct {
	// contains filtered or unexported fields
}

func (*Terminal) Close

func (t *Terminal) Close(ctx context.Context) error

func (*Terminal) DumpScreen

func (t *Terminal) DumpScreen(ctx context.Context, format DumpFormat) (*ScreenDump, error)

func (*Terminal) EncodeKey

func (t *Terminal) EncodeKey(ctx context.Context, keyCode KeyCode, mods Modifier) ([]byte, error)

func (*Terminal) Feed

func (t *Terminal) Feed(ctx context.Context, data []byte) error

Data larger than the feed buffer is automatically chunked.

func (*Terminal) GetPwd

func (t *Terminal) GetPwd(ctx context.Context) string

func (*Terminal) Resize

func (t *Terminal) Resize(ctx context.Context, cols, rows uint32) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL