libghostty

package
v0.0.0-...-8d207e6 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package libghostty wraps the translated Ghostty VT module used by hauntty.

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{}

func NewRuntime

func NewRuntime() (*Runtime, error)

func (*Runtime) Close

func (r *Runtime) Close() error

func (*Runtime) NewTerminal

func (r *Runtime) NewTerminal(cols, rows, scrollback uint32) (*Terminal, error)

type ScreenDump

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

type Terminal

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

func (*Terminal) Close

func (t *Terminal) Close() error

func (*Terminal) DumpScreen

func (t *Terminal) DumpScreen(format DumpFormat) (*ScreenDump, error)

func (*Terminal) EncodeKey

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

func (*Terminal) Feed

func (t *Terminal) Feed(data []byte) error

Feed writes terminal input, chunking data larger than the shared feed buffer.

func (*Terminal) GetCwd

func (t *Terminal) GetCwd() (string, bool, error)

func (*Terminal) Resize

func (t *Terminal) Resize(cols, rows uint32) error

Directories

Path Synopsis
Package wasmvt contains code generated from the vt Zig wrapper around Ghostty.
Package wasmvt contains code generated from the vt Zig wrapper around Ghostty.

Jump to

Keyboard shortcuts

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