vt

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package vt provides a virtual terminal that implements tuist.Terminal backed by midterm.Terminal. It interprets all ANSI escape sequences exactly as a real terminal would — cursor movement, colors, line clearing, synchronized output, etc. — making it ideal for testing, headless rendering, and golden file snapshots.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Terminal

type Terminal struct {
	// VT is the underlying virtual terminal. Access it directly to
	// inspect content, cursor position, cell formatting, etc.
	VT *midterm.Terminal
}

Terminal implements tuist.Terminal backed by a midterm.Terminal. All output from the TUI is interpreted by the virtual terminal, producing a pixel-perfect representation of what a real terminal would display.

func New

func New(cols, rows int) *Terminal

New creates a Terminal with the given dimensions.

func (*Terminal) Columns

func (m *Terminal) Columns() int

func (*Terminal) HideCursor

func (m *Terminal) HideCursor()

func (*Terminal) Render

func (m *Terminal) Render() string

Render returns the virtual terminal's content as a string including ANSI escape sequences for colors and formatting, capturing the full styled appearance as a real terminal would display it.

func (*Terminal) Rows

func (m *Terminal) Rows() int

func (*Terminal) SetInputPassthrough

func (m *Terminal) SetInputPassthrough(io.Writer)

func (*Terminal) ShowCursor

func (m *Terminal) ShowCursor()

func (*Terminal) Start

func (m *Terminal) Start(onInput func([]byte), onResize func()) error

func (*Terminal) Stop

func (m *Terminal) Stop()

func (*Terminal) Write

func (m *Terminal) Write(p []byte)

func (*Terminal) WriteString

func (m *Terminal) WriteString(s string)

Jump to

Keyboard shortcuts

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