vterm

package
v1.0.260758 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModNone  = 0
	ModShift = 1
	ModAlt   = 2
	ModCtrl  = 4
)
View Source
const (
	KeyEnter     = 1
	KeyTab       = 2
	KeyBackspace = 3
	KeyEscape    = 4
	KeyUp        = 5
	KeyDown      = 6
	KeyLeft      = 7
	KeyRight     = 8
	KeyIns       = 9
	KeyDel       = 10
	KeyHome      = 11
	KeyEnd       = 12
	KeyPageUp    = 13
	KeyPageDown  = 14
)

Variables

This section is empty.

Functions

func KeyFunction

func KeyFunction(n int) int

Types

type Term

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

Term wraps a libvterm instance with dirty tracking and scrollback.

func New

func New(rows, cols, scrollback int) *Term

New creates a new terminal emulator.

func (*Term) AltScreen

func (t *Term) AltScreen() bool

func (*Term) Close

func (t *Term) Close()

func (*Term) Cursor

func (t *Term) Cursor() (x, y int, visible bool)

func (*Term) Generation

func (t *Term) Generation() uint64

func (*Term) HasScrollback

func (t *Term) HasScrollback() bool

func (*Term) KeyboardKey

func (t *Term) KeyboardKey(key int, mod int) []byte

func (*Term) KeyboardUnichar

func (t *Term) KeyboardUnichar(r rune, mod int) []byte

func (*Term) MouseButton

func (t *Term) MouseButton(button int, pressed bool, row, col, mod int) []byte

MouseButton sends a mouse button via libvterm (row/col 0-based).

func (*Term) MouseMode

func (t *Term) MouseMode() int

func (*Term) MouseMove

func (t *Term) MouseMove(row, col, mod int) []byte

func (*Term) ProduceDiff

func (t *Term) ProduceDiff() cell.Diff

func (*Term) Resize

func (t *Term) Resize(rows, cols int)

func (*Term) ScrollBy

func (t *Term) ScrollBy(delta int)

ScrollBy moves the viewport into scrollback. Positive = up into history.

func (*Term) ScrollOffset

func (t *Term) ScrollOffset() int

func (*Term) ScrollUIState

func (t *Term) ScrollUIState() (offset, content, viewport int)

ScrollUIState returns scrollbar metrics: offset 0 = top of history, max = live bottom.

func (*Term) SearchScrollback

func (t *Term) SearchScrollback(query string, towardOlder bool) (found bool, matches int)

SearchScrollback finds query in scrollback+screen. towardOlder=true searches into history. On success, scrolls so the match line is visible near the top and returns true.

func (*Term) SetOutputCallback

func (t *Term) SetOutputCallback(fn func([]byte))

func (*Term) SetScrollUIOffset

func (t *Term) SetScrollUIOffset(offset int)

SetScrollUIOffset sets scroll position from a UI scrollbar (0 = top of history).

func (*Term) Size

func (t *Term) Size() (cols, rows int)

func (*Term) Snapshot

func (t *Term) Snapshot() []cell.Cell

func (*Term) TakeBell

func (t *Term) TakeBell() bool

TakeBell returns true if one or more BEL sequences arrived since the last call.

func (*Term) Title

func (t *Term) Title() string

func (*Term) Write

func (t *Term) Write(p []byte)

Jump to

Keyboard shortcuts

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