Documentation
¶
Index ¶
- func FastHash(s string) uint64
- func HexColor(hex string) vterm.Color
- func RenderTerminal(term *vterm.VTerm, width, height int, showCursor bool, fg, bg vterm.Color) string
- func RenderTerminalWithCanvas(canvas *Canvas, term *vterm.VTerm, width, height int, showCursor bool, ...) string
- type Canvas
- func (c *Canvas) DrawBorder(x, y, w, h int, style vterm.Style, focused bool)
- func (c *Canvas) DrawScreen(x, y, w, h int, screen [][]vterm.Cell, cursorX, cursorY int, showCursor bool, ...)
- func (c *Canvas) DrawText(x, y int, text string, style vterm.Style)
- func (c *Canvas) Fill(style vterm.Style)
- func (c *Canvas) Render() string
- func (c *Canvas) Resize(width, height int)
- func (c *Canvas) SetCell(x, y int, cell vterm.Cell)
- type ChromeCache
- type PositionedVTermLayer
- type StringDrawable
- type VTermLayer
- type VTermSnapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Canvas ¶
type Canvas struct {
Width int
Height int
Cells [][]vterm.Cell
// contains filtered or unexported fields
}
Canvas is a fixed-size buffer of styled cells.
func (*Canvas) DrawBorder ¶
DrawBorder draws a single or double line border.
func (*Canvas) DrawScreen ¶
func (c *Canvas) DrawScreen(x, y, w, h int, screen [][]vterm.Cell, cursorX, cursorY int, showCursor bool, viewOffset int, selActive bool, selStartX, selStartY, selEndX, selEndY int)
DrawScreen draws a vterm screen into the canvas with clipping.
type ChromeCache ¶
type ChromeCache struct {
// contains filtered or unexported fields
}
ChromeCache caches a StringDrawable for static pane chrome. Reuse the cached drawable when layout/content hasn't changed.
func (*ChromeCache) Get ¶
func (c *ChromeCache) Get(content string, width, height int, focused bool, posX, posY int) *StringDrawable
Get returns the cached StringDrawable if the parameters match. Returns nil if cache is invalid and needs rebuild.
func (*ChromeCache) Set ¶
func (c *ChromeCache) Set(content string, width, height int, focused bool, posX, posY int, drawable *StringDrawable)
Set updates the cache with a new StringDrawable.
type PositionedVTermLayer ¶
type PositionedVTermLayer struct {
*VTermLayer
PosX, PosY int
Width, Height int
}
type StringDrawable ¶
type StringDrawable struct {
// contains filtered or unexported fields
}
StringDrawable wraps a styled ANSI string to implement uv.Drawable. This allows string-based content to be composed onto a lipgloss.Canvas.
func NewStringDrawable ¶
func NewStringDrawable(content string, x, y int) *StringDrawable
NewStringDrawable creates a drawable from a styled string at the given position.
type VTermLayer ¶
type VTermLayer struct {
Snap *VTermSnapshot
}
VTermLayer implements tea.Layer for direct cell-based rendering of a VTerm snapshot. This uses a snapshot to avoid data races - the snapshot is created while holding the VTerm lock, and rendering happens without any locks.
func NewVTermLayer ¶
func NewVTermLayer(snap *VTermSnapshot) *VTermLayer
NewVTermLayer creates a new layer from a VTerm snapshot.
type VTermSnapshot ¶
type VTermSnapshot struct {
Screen [][]vterm.Cell
DirtyLines []bool
AllDirty bool
CursorX int
CursorY int
ViewOffset int
CursorHidden bool
ShowCursor bool
Width int
Height int
// Selection state (used during rendering)
SelActive bool
SelStartX, SelStartY int
SelEndX, SelEndY int
}
func NewVTermSnapshot ¶
func NewVTermSnapshot(term *vterm.VTerm, showCursor bool) *VTermSnapshot
NewVTermSnapshot creates a snapshot from a VTerm. MUST be called while holding the appropriate lock on the VTerm.
func NewVTermSnapshotWithCache ¶
func NewVTermSnapshotWithCache(term *vterm.VTerm, showCursor bool, prev *VTermSnapshot) *VTermSnapshot
NewVTermSnapshotWithCache creates a snapshot from a VTerm, optionally reusing lines from a previous snapshot when dirty line tracking allows. MUST be called while holding the appropriate lock on the VTerm.