vt

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package vt defines Loom's pane-display abstraction. An Emulator consumes raw PTY bytes from the tmux-client stream and renders the current visible screen as a string the UI prints verbatim. tmux remains the session owner; this is display only.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cursor

type Cursor struct {
	X, Y    int
	Visible bool
}

Cursor is the visible cursor position in cells, 0-based, origin top-left.

type Emulator

type Emulator interface {
	// Write feeds raw PTY bytes (ANSI/CSI/OSC/DCS) into the emulator. It
	// mirrors io.Writer so it can be the output pump's destination directly.
	Write(p []byte) (n int, err error)

	// Resize sets the emulator's screen geometry in cells.
	Resize(cols, rows int)

	// Render returns the current VISIBLE screen as a string with embedded
	// ANSI SGR sequences, sized to the last Resize. The UI prints this verbatim.
	Render() string

	// Cursor returns the current cursor position and visibility.
	Cursor() Cursor

	// Close releases emulator resources. Safe to call multiple times.
	Close() error
}

Emulator is the display surface for one pane. Implementations must be safe for one writer goroutine (the tmux output pump calling Write) concurrent with reader calls (Render/Cursor) from the Bubble Tea Update goroutine.

func NewXVT

func NewXVT(cols, rows int) Emulator

NewXVT constructs a real terminal emulator sized to cols x rows.

Jump to

Keyboard shortcuts

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